{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/jquery/dist/jquery.js","webpack:///./node_modules/angular/index.js","webpack:///./node_modules/braintree-web/dist/browser/index.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/angular/angular.js","webpack:///./node_modules/timers-browserify/main.js","webpack:///./node_modules/setimmediate/setImmediate.js","webpack:///./node_modules/process/browser.js","webpack:///./app/javascript/src/application.js","webpack:///./app/javascript/src/services/validator.js","webpack:///./app/javascript/src/services/price_calculator.js","webpack:///./app/javascript/src/services/braintree_client.js","webpack:///./app/javascript/src/controllers/payments_ctrl.js","webpack:///./app/javascript/src/controllers/type_ctrl.js","webpack:///./app/javascript/src/directives/scroll.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","global","factory","document","w","Error","window","this","noGlobal","arr","getProto","getPrototypeOf","slice","flat","array","concat","apply","push","indexOf","class2type","toString","hasOwn","fnToString","ObjectFunctionString","support","isFunction","obj","nodeType","item","isWindow","preservedScriptAttributes","type","src","nonce","noModule","DOMEval","code","node","doc","val","script","createElement","text","getAttribute","setAttribute","head","appendChild","parentNode","removeChild","toType","version","rhtmlSuffix","jQuery","selector","context","fn","init","isArrayLike","length","nodeName","elem","toLowerCase","jquery","constructor","toArray","num","pushStack","elems","ret","merge","prevObject","each","callback","map","arguments","first","eq","last","even","grep","_elem","odd","len","j","end","sort","splice","extend","options","copy","copyIsArray","clone","target","deep","isPlainObject","Array","isArray","undefined","expando","Math","random","replace","isReady","error","msg","noop","proto","Ctor","isEmptyObject","globalEval","textContent","documentElement","nodeValue","makeArray","results","inArray","isXMLDoc","namespace","namespaceURI","docElem","ownerDocument","test","second","invert","matches","callbackExpect","arg","guid","iterator","split","_i","pop","whitespace","rtrimCSS","RegExp","contains","a","b","bup","compareDocumentPosition","rcssescape","fcssescape","ch","asCodePoint","charCodeAt","escapeSelector","sel","preferredDoc","pushNative","Expr","outermostContext","sortInput","hasDuplicate","documentIsHTML","rbuggyQSA","dirruns","done","classCache","createCache","tokenCache","compilerCache","nonnativeSelectorCache","sortOrder","booleans","identifier","attributes","pseudos","rwhitespace","rcomma","rleadingCombinator","rdescend","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","bool","needsContext","rinputs","rheader","rquickExpr","rsibling","runescape","funescape","escape","nonHex","high","String","fromCharCode","unloadHandler","setDocument","inDisabledFieldset","addCombinator","disabled","dir","next","childNodes","e","els","find","seed","nid","match","groups","newSelector","newContext","exec","getElementById","id","getElementsByTagName","getElementsByClassName","testContext","scope","tokenize","toSelector","join","querySelectorAll","qsaError","removeAttribute","select","keys","cache","cacheLength","shift","markFunction","assert","el","createInputPseudo","createButtonPseudo","createDisabledPseudo","isDisabled","createPositionalPseudo","argument","matchIndexes","subWindow","webkitMatchesSelector","msMatchesSelector","defaultView","top","addEventListener","getById","getElementsByName","disconnectedMatch","cssHas","querySelector","filter","attrId","getAttributeNode","tag","className","input","innerHTML","compare","sortDetached","expr","elements","matchesSelector","attr","attrHandle","uniqueSort","duplicates","sortStable","createPseudo","relative","preFilter","excess","unquoted","nodeNameSelector","expectedNodeName","pattern","operator","check","result","what","_argument","simple","forward","ofType","_context","xml","outerCache","nodeIndex","start","parent","useCache","diff","firstChild","lastChild","pseudo","args","setFilters","idx","matched","not","matcher","compile","unmatched","has","lang","elemLang","hash","location","root","focus","activeElement","err","safeActiveElement","hasFocus","href","tabIndex","enabled","checked","selected","selectedIndex","empty","nextSibling","header","button","_matchIndexes","lt","gt","nth","radio","checkbox","file","password","image","submit","reset","parseOnly","tokens","soFar","preFilters","cached","combinator","base","skip","checkNonElements","doneName","oldCache","newCache","elementMatcher","matchers","condense","newUnmatched","mapped","setMatcher","postFilter","postFinder","postSelector","temp","matcherOut","preMap","postMap","preexisting","contexts","multipleContexts","matcherIn","matcherFromTokens","checkContext","leadingRelative","implicitRelative","matchContext","matchAnyContext","setMatchers","elementMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","matcherFromGroupMatchers","token","compiled","filters","unique","getText","isXML","selectors","until","truncate","is","siblings","rneedsContext","rsingleTag","winnow","qualifier","self","rootjQuery","parseHTML","ready","rparentsprev","guaranteedUnique","children","contents","prev","sibling","cur","targets","closest","index","prevAll","add","addBack","parents","parentsUntil","nextAll","nextUntil","prevUntil","contentDocument","content","reverse","rnothtmlwhite","Identity","v","Thrower","ex","adoptValue","resolve","reject","noValue","method","promise","fail","then","Callbacks","_","flag","createOptions","firing","memory","fired","locked","list","queue","firingIndex","fire","once","stopOnFalse","remove","disable","lock","fireWith","Deferred","func","tuples","state","always","deferred","pipe","fns","newDefer","tuple","returned","progress","notify","onFulfilled","onRejected","onProgress","maxDepth","depth","handler","special","that","mightThrow","TypeError","notifyWith","resolveWith","process","exceptionHook","rejectWith","getErrorHook","getStackHook","setTimeout","stateString","when","singleValue","remaining","resolveContexts","resolveValues","primary","updateFunc","rerrorNames","asyncError","console","warn","message","stack","readyException","readyList","completed","removeEventListener","catch","readyWait","wait","readyState","doScroll","access","chainable","emptyGet","raw","bulk","_key","rmsPrefix","rdashAlpha","fcamelCase","_all","letter","toUpperCase","camelCase","string","acceptData","owner","Data","uid","configurable","set","data","prop","hasData","dataPriv","dataUser","rbrace","rmultiDash","dataAttr","JSON","parse","getData","removeData","_data","_removeData","attrs","dequeue","startLength","hooks","_queueHooks","unshift","stop","setter","clearQueue","tmp","count","defer","pnum","source","rcssNum","cssExpand","isAttached","composed","getRootNode","isHiddenWithinTree","style","display","css","adjustCSS","valueParts","tween","adjusted","scale","maxIterations","currentValue","initial","unit","cssNumber","initialInUnit","defaultDisplayMap","getDefaultDisplay","body","showHide","show","values","hide","toggle","div","rcheckableType","rtagName","rscriptType","createDocumentFragment","checkClone","cloneNode","noCloneChecked","defaultValue","option","wrapMap","thead","col","tr","td","_default","getAll","setGlobalEval","refElements","tbody","tfoot","colgroup","caption","th","optgroup","rhtml","buildFragment","scripts","selection","ignored","wrap","attached","fragment","nodes","htmlPrefilter","createTextNode","rtypenamespace","returnTrue","returnFalse","on","types","one","origFn","event","off","leverageNative","isSetup","saved","isTrigger","delegateType","stopPropagation","stopImmediatePropagation","preventDefault","trigger","isImmediatePropagationStopped","handleObjIn","eventHandle","events","handleObj","handlers","namespaces","origType","elemData","handle","triggered","dispatch","bindType","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","nativeEvent","handlerQueue","fix","delegateTarget","preDispatch","isPropagationStopped","currentTarget","rnamespace","postDispatch","matchedHandlers","matchedSelectors","addProp","hook","Event","originalEvent","writable","load","noBubble","click","beforeunload","returnValue","props","isDefaultPrevented","defaultPrevented","relatedTarget","timeStamp","Date","now","isSimulated","altKey","bubbles","cancelable","changedTouches","ctrlKey","detail","eventPhase","metaKey","pageX","pageY","shiftKey","view","charCode","keyCode","buttons","clientX","clientY","offsetX","offsetY","pointerId","pointerType","screenX","screenY","targetTouches","toElement","touches","which","blur","focusMappedHandler","documentMode","simulate","attaches","dataHolder","mouseenter","mouseleave","pointerenter","pointerleave","orig","related","rnoInnerhtml","rchecked","rcleanScript","manipulationTarget","disableScript","restoreScript","cloneCopyEvent","dest","udataOld","udataCur","fixInput","domManip","collection","hasScripts","iNoClone","valueIsFunction","html","_evalUrl","keepData","cleanData","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","detach","append","prepend","insertBefore","before","after","replaceWith","replaceChild","appendTo","prependTo","insertAfter","replaceAll","original","insert","rnumnonpx","rcustomProp","getStyles","opener","getComputedStyle","swap","old","rboxStyle","curCSS","computed","width","minWidth","maxWidth","isCustomProp","getPropertyValue","pixelBoxStyles","addGetHookIf","conditionFn","hookFn","computeStyleTests","container","cssText","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","marginLeft","right","pixelBoxStylesVal","boxSizingReliableVal","position","scrollboxSizeVal","offsetWidth","measure","round","parseFloat","reliableTrDimensionsVal","backgroundClip","clearCloneStyle","boxSizingReliable","pixelPosition","reliableMarginLeft","scrollboxSize","reliableTrDimensions","table","trChild","trStyle","height","parseInt","borderTopWidth","borderBottomWidth","offsetHeight","cssPrefixes","emptyStyle","vendorProps","finalPropName","final","cssProps","capName","vendorPropName","rdisplayswap","cssShow","visibility","cssNormalTransform","letterSpacing","fontWeight","setPositiveNumber","subtract","max","boxModelAdjustment","dimension","box","isBorderBox","styles","computedVal","extra","delta","marginDelta","ceil","getWidthOrHeight","valueIsBorderBox","offsetProp","getClientRects","Tween","easing","cssHooks","opacity","animationIterationCount","aspectRatio","borderImageSlice","columnCount","flexGrow","flexShrink","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineHeight","order","orphans","widows","zIndex","zoom","fillOpacity","floodOpacity","stopOpacity","strokeMiterlimit","strokeOpacity","origName","setProperty","isFinite","getBoundingClientRect","scrollboxSizeBuggy","left","margin","padding","border","prefix","suffix","expand","expanded","parts","propHooks","run","percent","eased","duration","pos","step","fx","scrollTop","scrollLeft","linear","swing","cos","PI","fxNow","inProgress","rfxtypes","rrun","schedule","hidden","requestAnimationFrame","interval","tick","createFxNow","genFx","includeWidth","createTween","animation","Animation","tweeners","properties","stopped","prefilters","currentTime","startTime","tweens","opts","specialEasing","originalProperties","originalOptions","gotoEnd","propFilter","complete","timer","anim","tweener","oldfire","propTween","restoreDisplay","isBox","dataShow","unqueued","overflow","overflowX","overflowY","prefilter","speed","opt","speeds","fadeTo","to","animate","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","slow","fast","delay","time","timeout","clearTimeout","checkOn","optSelected","radioValue","boolHook","removeAttr","nType","attrHooks","attrNames","lowercaseName","rfocusable","rclickable","stripAndCollapse","getClass","classesToArray","removeProp","propFix","tabindex","addClass","classNames","curValue","finalValue","removeClass","toggleClass","stateVal","isValidValue","hasClass","rreturn","valHooks","optionSet","rquery","parseXML","parserErrorElem","DOMParser","parseFromString","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","parentWindow","triggerHandler","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","traditional","param","valueOrFunction","encodeURIComponent","serialize","serializeArray","r20","rhash","rantiCache","rheaders","rnoContent","rprotocol","transports","allTypes","originAnchor","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","seekingTransport","inspect","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","active","lastModified","etag","url","isLocal","protocol","processData","async","contentType","accepts","json","responseFields","converters","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","transport","cacheURL","responseHeadersString","responseHeaders","timeoutTimer","urlAnchor","fireGlobals","uncached","callbackContext","globalEventContext","completeDeferred","statusCode","requestHeaders","requestHeadersNames","strAbort","getResponseHeader","getAllResponseHeaders","setRequestHeader","overrideMimeType","mimeType","status","abort","statusText","finalText","crossDomain","host","hasContent","ifModified","headers","beforeSend","success","send","nativeStatusText","responses","isSuccess","response","modified","ct","finalDataType","firstDataType","ajaxHandleResponses","conv2","current","conv","dataFilter","throws","ajaxConvert","getJSON","getScript","wrapAll","firstElementChild","wrapInner","htmlIsFunction","unwrap","visible","xhr","XMLHttpRequest","xhrSuccessStatus","xhrSupported","cors","errorCallback","open","username","xhrFields","onload","onerror","onabort","ontimeout","onreadystatechange","responseType","responseText","binary","scriptAttrs","charset","scriptCharset","evt","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","createHTMLDocument","implementation","keepScripts","parsed","params","animated","offset","setOffset","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","curElem","using","rect","win","pageYOffset","pageXOffset","offsetParent","parentOffset","scrollTo","Height","Width","defaultExtra","funcName","unbind","delegate","undelegate","hover","fnOver","fnOut","rtrim","proxy","holdReady","hold","parseJSON","isNumeric","isNaN","trim","_jQuery","_$","$","noConflict","angular","define","f","u","_dereq_","__importDefault","mod","PromiseGlobal","promise_polyfill_1","Promise","default","promise_1","scriptPromiseCache","loadScript","scriptLoadPromise","stringifiedOptions","stringify","forceScriptReload","dataAttributes","crossorigin","forEach","clearCache","ua","navigator","userAgent","isEdge","isSamsung","isDuckDuckGo","isOpera","isSilk","isIos","isGoogleSearchApp","isIosFirefox","webkitRegexp","isWebkit","isIosChrome","isFacebook","isIosGoogleSearchApp","isIosWebview","statusBarVisible","statusbar","isIpadOS","checkIpadOS","iOsTest","MINIMUM_SUPPORTED_CHROME_IOS_VERSION","isAndroid","isChrome","isSamsungBrowser","isUnsupportedIosChrome","isOperaMini","isAndroidWebview","androidWebviewRegExp","isOldSamsungBrowserOrSamsungWebview","EventEmitter","_events","eventCallbacks","indexOfCallback","_emit","hasListener","createChild","ChildObject","GlobalPromise","ExtendedPromise","_this","_promise","_resolveFunction","_rejectFunction","_onResolve","onResolve","defaultOnResolve","_onReject","onReject","defaultOnReject","shouldCatchExceptions","_resetState","setPromise","PromiseClass","Boolean","suppressUnhandledPromiseMessage","all","allSettled","race","_a","isFulfilled","_setResolved","argForResolveFunction","_setRejected","isResolved","isRejected","set_attributes_1","default_attributes_1","assign_1","iframe","config","assign","defaultAttributes","setAttributes","objs","frameBorder","allowtransparency","scrolling","element","uuid","log","called","promiseOrCallback","deferred_1","once_1","promise_or_callback_1","wrapPromise","wrapPrototype","ignoreMethods","includePrivateMethods","transformPrivateMethods","getOwnPropertyNames","isNotPrivateMethod","isNonConstructorFunction","isNotAnIgnoredMethod","charAt","__assign","cardTypes","add_matching_cards_to_results_1","is_valid_input_type_1","find_best_match_1","clone_1","customCards","cardNames","VISA","MASTERCARD","AMERICAN_EXPRESS","DINERS_CLUB","DISCOVER","JCB","UNIONPAY","MAESTRO","ELO","MIR","HIPER","HIPERCARD","ORIGINAL_TEST_ORDER","testOrder","findType","cardType","getAllCardTypes","getCardPosition","ignoreErrorForNotExisting","creditCardType","cardNumber","isValidInputType","cardConfiguration","addMatchingCardsToResults","bestMatch","findBestMatch","getTypeInfo","removeCard","addCard","existingCardPosition","updateCard","updates","originalObject","clonedCard","changeOrder","currentPosition","resetModifications","matches_1","patternLength","patterns","clonedCardConfiguration","matchStrength","visa","niceType","gaps","lengths","size","mastercard","discover","jcb","unionpay","maestro","elo","mir","hiper","hipercard","hasEnoughResultsToDetermineBestMatch","numberOfResultsWithMaxStrengthProperty","reduce","Number","matchesRange","min","maxLengthToCheck","substr","integerRepresentationOfCardNumber","matchesPattern","substring","Framebus","lib_1","DefaultPromise","origin","channel","verifyDomain","targetFrames","limitBroadcastToFramesArray","isDestroyed","listeners","hasAdditionalChecksForOnListeners","addTargetFrame","frame","include","childWindow","Window","childWindows","emit","eventName","reply","namespaceEvent","isntString","payload","packagePayload","targetFramesAsWindows","sendMessage","broadcast","emitAsPromise","originalHandler","subscriptionArgsInvalid","passesVerifyDomainCheck","hasMatchingTargetFrame","subscribers","listener","subscriberList","checkOrigin","HTMLIFrameElement","contentWindow","matchingFrame","postMessageOrigin","merchantHost","framebus_1","attach","_1","onMessage","broadcastToChildWindows","closed","frameToBroadcastTo","postMessage","hasOpener","frames","__createBinding","k","k2","desc","getOwnPropertyDescriptor","__exportStar","str","unpackPayload","eventData","packaged","subscribeReplier","uuid_1","replier","replyOriginHandler","replyOrigin_1","replySource_1","replyEvent_1","replyData","replyPayload","finallyConstructor","reason","res","setTimeoutFunc","x","thisArg","_state","_handled","_value","_deferreds","doResolve","_immediateFn","cb","newValue","finale","_unhandledRejectionFn","Handler","prom","setImmediate","isIE9","isAndroidChrome","isKitKatWebview","UA","isChromeOs","KITKAT_WEBVIEW_REGEX","device_1","BraintreeError","errors","methods","convertMethodsToError","AmericanExpress","_client","client","getRewardsBalance","_meta","paymentMethodNonce","request","endpoint","AMEX_NETWORK_ERROR","details","originalError","AMEX_NONCE_REQUIRED","getExpressCheckoutProfile","MERCHANT","NETWORK","basicComponentVerification","createDeferredClient","createAssetsUrl","VERSION","verify","authorization","debug","assetsUrl","analytics","ApplePay","_instantiatedWithClient","useDeferredClient","_createPromise","createPromise","_setMerchantIdentifier","_waitForClient","applePayConfig","getConfiguration","gatewayConfiguration","applePayWeb","merchantIdentifier","createPaymentRequest","paymentRequest","_createPaymentRequestSynchronously","applePay","defaults","countryCode","currencyCode","merchantCapabilities","supportedNetworks","network","performValidation","validationURL","applePayWebSession","validationUrl","domainName","hostname","displayName","sendEvent","APPLE_PAY_MERCHANT_VALIDATION_FAILED","APPLE_PAY_MERCHANT_VALIDATION_NETWORK","APPLE_PAY_VALIDATION_URL_REQUIRED","applePaymentToken","paymentData","btoa","applePayCards","APPLE_PAY_TOKENIZATION","APPLE_PAY_PAYMENT_TOKEN_REQUIRED","APPLE_PAY_NOT_ENABLED","applePayInstance","BRAINTREE_VERSION","GraphQL","isVerifiedDomain","convertToBraintreeError","getGatewayConfiguration","createAuthorizationData","addMetadata","GRAPHQL_URLS","assets","FRAUDNET_FNCLS","FRAUDNET_SOURCE","FRAUDNET_URL","cachedClients","Client","configuration","configurationJSON","CLIENT_MISSING_GATEWAY_CONFIGURATION","CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN","_request","_configuration","_clientApiBaseUrl","clientApiUrl","graphQL","_graphQL","formatRequestError","requestError","CLIENT_REQUEST_TIMEOUT","CLIENT_AUTHORIZATION_INVALID","CLIENT_AUTHORIZATION_INSUFFICIENT","CLIENT_RATE_LIMITED","CLIENT_GATEWAY_NETWORK","CLIENT_REQUEST_ERROR","httpStatus","getAuthorizationHeadersForGraphQL","Authorization","authorizationFingerprint","initialize","clientInstance","authData","CLIENT_INVALID_AUTHORIZATION","isDebug","_findOrCreateFraudnetJSON","clientMetadataId","additionalData","parameters","rda_tenant","mid","merchantId","pieces","component","cid","fp","bu","requestPromise","optionName","api","baseUrl","requestOptions","shouldCollectData","creditCards","collectDeviceData","CLIENT_OPTION_REQUIRED","metadata","analyticsMetadata","CLIENT_OPTION_INVALID","environment","clientSdkMetadata","platform","integration","sessionId","sendAnalyticsEvent","kind","resolvedData","CLIENT_GRAPHQL_REQUEST_ERROR","_httpStatus","toJSON","getVersion","INTERNAL","constants","isDateStringBeforeOrOn","configUrl","reqOptions","merchantAppId","PLATFORM","sdkVersion","SOURCE","INTEGRATION","integrationType","braintreeLibraryVersion","BRAINTREE_LIBRARY_VERSION","configVersion","date","features","tokenizationKey","errorTemplate","authorizationType","sharedErrors","INSTANTIATION_OPTION_REQUIRED","querystring","prepBody","parseBody","isXHRAvailable","isAvailable","GraphQLRequest","DefaultRequest","MAX_TCP_RETRYCOUNT","TCP_PRECONNECT_BUG_STATUS_CODE","requestShouldRetry","graphQLRequestShouldRetryWithClientApi","errorClass","extensions","_requestWithRetry","tcpRetryCount","resBody","ajaxRequest","parsedBody","req","getRequestObject","isGraphQLRequest","getUrl","getBody","getMethod","getHeaders","queryify","adaptResponseBody","determineStatus","onprogress","requestOpenError","headerKey","_url","_method","_headers","errorResponseAdapter","cardTypeTransforms","creditCard","INTERNATIONAL_MAESTRO","SOLO","UK_MAESTRO","UNION_PAY","visaCheckout","googlePay","masterpass","DINERS","configurationResponseAdapter","responseBody","ctx","adaptConfigurationResponseBody","clientConfiguration","analyticsUrl","venmo","supportedFeatures","_config","feature","braintreeApi","mapCardTypes","supportedCardBrands","ideal","kount","kountMerchantId","challenges","challenge","supportedCardTypes","threeDSecureEnabled","threeDSecure","androidPay","googleAuthorizationFingerprint","googleAuthorization","paypalClientId","payWithVenmo","accessToken","enrichedCustomerDataEnabled","paypal","paypalEnabled","currencyIsoCode","unionPay","merchantAccountId","apikey","apiKey","encryptionKey","externalClientId","merchantCheckoutId","usBankAccount","routeId","plaid","publicKey","plaidPublicKey","cardTypeTransformMap","acc","CARD_BRAND_MAP","BIN_DATA_MAP","YES","NO","UNKNOWN","AUTHENTICATION_INSIGHT_MAP","PSDTWO","creditCardTokenizationResponseAdapter","adaptTokenizeCreditCardResponseBody","regulationEnvironment","tokenizeCreditCard","lastTwo","last4","binData","consumed","description","cardholderName","expirationMonth","expirationYear","bin","brandCode","lastFour","threeDSecureInfo","authenticationInsight","customerAuthenticationRegulationEnvironment","userErrorResponseAdapter","errorWithClassResponseAdapter","fieldErrors","buildFieldErrors","getLegacyMessage","inputPath","addFieldError","errorDetail","fieldError","legacyCode","inputField","candidate","field","CONFIGURATION_QUERY","query","operationName","createMutation","hasAuthenticationInsight","mutation","createCreditCardTokenizationBody","cc","billingAddress","expDate","expirationDate","variables","number","cvv","authenticationInsightInput","addValidationRule","validate","creditCardTokenization","tokenize_credit_cards","disallowedInputPaths","containsDisallowedlistedKeys","some","accumulator","getGraphQLEndpoint","featureEnabled","path","getClientApiPath","_isGraphQLEnabled","clientApiPrefix","pathParts","snakeCaseToCamelCase","creditCardTokenizationBodyGenerator","configurationBodyGenerator","generators","adapters","clientApiPath","_clientSdkMetadata","_sendAnalyticsEvent","Function","_generator","_adapter","isGraphQLError","parsedResponse","formatBodyKeys","originalBody","camelCaseKey","formattedBody","generatedBody","AJAXDriver","XDomainRequest","DATA_COLLECTOR_KOUNT_NOT_ENABLED","DATA_COLLECTOR_KOUNT_ERROR","DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS","cachedSessionId","fraudNet","Fraudnet","clearSessionIdCache","removeElementIfOnPage","_generateSessionId","floor","_generateBeaconId","getTime","_createParameterBlock","beaconId","sandbox","_beaconId","_parameterBlock","block","_thirdPartyBlock","fraudnet","_instances","_instantiatedWithAClient","kountInstance","deviceData","riskCorrelationId","correlationId","fraudnetInstance","correlation_id","rawDeviceData","createTeardownMethod","getDeviceData","createGetDeviceDataMethod","instance","sjcl","camelCaseToSnakeCase","QA_URL","IFRAME_ID_PREFIX","environmentUrls","development","qa","production","cachedDeviceData","Kount","previouslyInitializedDeviceData","getCachedDeviceData","_isCached","_currentEnvironment","_initializeEnvironment","startCollectors","_deviceSessionId","_generateDeviceSessionId","_getDeviceData","setCachedDeviceData","_iframe","_setupIFrame","stopCollectors","_removeIframe","deviceSessionId","fraudMerchantId","bits","randomWords","codec","hex","fromBits","title","cipher","keyexchange","misc","exception","corrupt","invalid","bug","notReady","g","h","q","A","B","C","performance","addEntropy","valueOf","y","z","aes","encrypt","G","decrypt","bitArray","bitSlice","M","clamp","extract","getPartial","bitLength","partial","equal","Y","byteswapM","utf8String","decodeURIComponent","toBits","unescape","sha256","update","finalize","blockSize","K","Uint32Array","subarray","pow","prng","H","F","J","L","T","D","seeded","S","O","I","P","N","setDefaultParanoia","getProgress","loadTimeCollector","V","mouseCollector","W","keyboardCollector","U","accelerometerCollector","R","touchCollector","X","attachEvent","detachEvent","accelerationIncludingGravity","orientation","E","randomBytes","Uint8Array","buffer","crypto","getRandomValues","msCrypto","GOOGLE_PAYMENT_NOT_ENABLED","GOOGLE_PAYMENT_GATEWAY_ERROR","GOOGLE_PAYMENT_UNSUPPORTED_VERSION","generateGooglePayConfiguration","CREATE_PAYMENT_DATA_REQUEST_METHODS","GooglePayment","_useDeferredClient","_googlePayVersion","googlePayVersion","_googleMerchantId","googleMerchantId","_isUnsupportedGooglePayAPIVersion","applyDefaultsToPaymentMethodConfiguration","merchantSubmittedPaymentMethod","defaultPaymentMethod","parameter","_getDefaultConfig","_defaultConfig","_createV1PaymentDataRequest","paymentDataRequest","defaultConfig","overrideCardNetworks","cardRequirements","allowedCardNetworks","defaultConfigCardNetworks","_createV2PaymentDataRequest","allowedPaymentMethods","paymentMethod","createPaymentDataRequest","overrides","_createPaymentDataRequestSyncronously","createPaymentDataRequestMethod","parseResponse","rawResponse","apiVersion","paymentMethodData","tokenizationData","paymentMethodToken","paypalAccounts","androidPayCards","isNetworkTokenized","allowedAttributes","attributeValidationError","attribute","_isValid","HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED","HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED","useMin","componentId","directions","navigationDirections","browserDetection","focusIntercept","findParentTags","userFocusableTagNames","unfocusedInputTypes","_isUserFocusableElement","hasSoftwareKeyboard","tagName","_createNavigationHelper","direction","numberOfElementsInForm","BACK","checkIndexBounds","indexChange","FORWARD","_findFirstFocusableElement","elementsInForm","elementsIndex","removeExtraFocusElements","checkoutForm","onRemoveFocusIntercepts","matchFocusElement","createFocusChangeHandler","hostedFieldsId","callbacks","currentIndex","targetElement","navHelper","sourceElement","forms","onTriggerInputFocus","allowedStyles","cssClass","computedStyles","Destructor","iFramer","Bus","composeUrl","getStylesFromClass","INTEGRATION_TIMEOUT_MS","injectFrame","allowedFields","shadow","findRootNode","getCardTypes","focusChange","destroyFocusIntercept","destroy","SAFARI_FOCUS_TIMEOUT","createInputEventHandler","fields","merchantPayload","emittedBy","containerElement","classList","externalClasses","FOCUSED","isFocused","VALID","isValid","INVALID","isPotentiallyValid","cards","isVisibleEnough","boundingBox","verticalMidpoint","horizontalMidpoint","innerHeight","clientHeight","bottom","innerWidth","clientWidth","HostedFields","failureTimeout","clientConfig","hostedFieldsUrl","frameReadyPromiseResolveFunctions","frameReadyPromises","_merchantConfigurationOptions","_clientPromise","_injectedNodes","_destructor","_fields","_bus","registerFunctionForTeardown","externalContainer","internalContainer","frameReadyPromise","HOSTED_FIELDS_INVALID_FIELD_KEY","HOSTED_FIELDS_INVALID_FIELD_SELECTOR","fieldSelector","fieldContainer","fieldKey","HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME","isShadowElement","transformToSlot","maxlength","HOSTED_FIELDS_FIELD_PROPERTY_INVALID","minlength","defaultIFrameStyle","iframeTitle","label","_setupLabelFocus","frameElement","isEmpty","REMOVE_FOCUS_INTERCEPTS","TRIGGER_FOCUS_CHANGE","targetType","READY_FOR_CLIENT","CARD_FORM_ENTRY_HAS_BEGUN","BIN_AVAILABLE","formatMerchantConfigurationForIframes","_cleanUpFocusIntercepts","FRAME_READY","INPUT_EVENT","methodNames","formattedConfig","labels","rootNode","triggerFocus","_getAnyFieldContainer","found","iframeContainer","_attachInvalidFieldContainersToError","invalidFieldKeys","invalidFields","getChallenges","getSupportedCardTypes","TOKENIZATION_REQUEST","classname","ADD_CLASS","HOSTED_FIELDS_FIELD_NOT_PRESENT","HOSTED_FIELDS_FIELD_INVALID","REMOVE_CLASS","attributeErr","SET_ATTRIBUTE","setMonthOptions","errorMessage","merchantOptions","SET_MONTH_OPTIONS","setMessage","SET_MESSAGE","REMOVE_ATTRIBUTE","setPlaceholder","placeholder","clear","CLEAR_FIELD","fieldConfig","TRIGGER_INPUT_FOCUS","scrollIntoView","getState","focusHandler","frameType","clearboth","focusInterceptBefore","generate","focusInterceptAfter","supportsInputFormatting","HOSTED_FIELDS_TIMEOUT","isChromeOS","isChromeIos","isFirefox","enumerate","maxExpirationYearAge","externalEvents","FOCUS","BLUR","EMPTY","NOT_EMPTY","VALIDITY_CHANGE","CARD_TYPE_CHANGE","defaultMaxLengths","postalCode","float","tokenizationErrorCodes","HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE","HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED","autocompleteMappings","expiration","HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR","CUSTOMER","HOSTED_FIELDS_FAILED_TOKENIZATION","HOSTED_FIELDS_FIELDS_EMPTY","HOSTED_FIELDS_FIELDS_INVALID","focusInterceptStyles","idString","focusInputs","idComponents","hasBTPrefix","isAllowedType","isValidDirection","card","americanExpress","dataCollector","hostedFields","localPayment","paypalCheckout","googlePayment","sepa","vaultManager","preferredPaymentMethods","jsonClone","authAttrs","clientInstanceOrPromise","timestamp","timestampInPromise","ANALYTICS_PREFIX","isAsync","ANALYTICS_REQUEST_TIMEOUT_MS","assignNormalized","assignPolyfill","destination","_assign","INCOMPATIBLE_VERSIONS","INVALID_USE_OF_INTERNAL_FUNCTION","functions","findRootError","transformKey","newObj","CLIENT_API_URLS","ASSETS_URLS","BUS_CONFIGURATION_REQUEST_EVENT","methodName","METHOD_CALLED_AFTER_TEARDOWN","originalErr","btErrorObject","atob","_isTokenizationKey","_parseTokenizationKey","parsedClientToken","parsedTokenizationKey","braintree","CLIENT_SCRIPT_FAILED_TO_LOAD","batchExecuteFunctions","_teardownRegistry","_isTearingDown","enumeration","Popup","PopupBridge","Modal","REQUIRED_CONFIG_KEYS","_validateFrameConfiguration","FrameService","_serviceId","_options","dispatchFrameUrl","openFrameUrl","_setBusEvents","dispatchFrameReadyHandler","DISPATCH_FRAME_READY","_writeDispatchFrame","frameName","DISPATCH_FRAME_NAME","frameSrc","_dispatchFrame","class","DISPATCH_FRAME_CLASS","DISPATCH_FRAME_REPORT","_onCompleteCallback","_frame","close","_getFrameForEnvironment","isFrameClosed","_cleanupFrame","FRAME_SERVICE_FRAME_OPEN_FAILED","_pollForPopupClose","redirect","createHandler","beforeClose","beforeFocus","createNoopHandler","isClosed","clearInterval","_popupInterval","setInterval","FRAME_SERVICE_FRAME_CLOSED","POPUP_POLL_INTERVAL","usePopup","supportsPopups","popupBridgeExists","popupBridge","initOptions","frameService","ELEMENT_STYLES","outline","background","_closed","_container","iframerConfig","isIosWKWebview","_lockScrolling","_el","_unlockScrolling","redirectUrl","_savedBodyProperties","overflowStyle","positionStyle","clientLeft","clientTop","onComplete","popupDismissed","calculatePosition","userDefinedPosition","DEFAULT_POPUP_HEIGHT","DEFAULT_POPUP_WIDTH","POPUP_BASE_OPTIONS","composeOptions","center","outerHeight","screenTop","outerWidth","screenLeft","windowMetric","popupMetric","POPUP_CLOSE_TIMEOUT","generateTokenizationParameters","basicTokenizationParameters","gateway","paypalPaymentMethod","androidPayConfiguration","apiVersionMinor","allowedAuthMethods","tokenizationSpecification","merchantInfo","purchase_context","purchase_units","payee","client_id","recurring_payment","paymentMethodTokenizationParameters","tokenizationType","convertDateStringToDate","dateString","splitDate","firstDate","secondDate","isHTTPS","parser","legalHosts","stripSubdomains","domain","mainDomain","_notEmpty","_isArray","hasQueryParams","toReturn","keyValue","getShadowHost","styleNode","shadowHost","slotName","slot","slotProvider","sheet","insertRule","snakeString","atobNormalized","atobPolyfill","base64String","b2","b3","characters","_atob","REQUIRED_OPTIONS_FOR_START_PAYMENT","REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE","REQUIRED_OPTIONS_FOR_ADDRESS","REQUIRED_OPTIONS_FOR_LINE_ITEMS","REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT","DEFAULT_WINDOW_WIDTH","DEFAULT_WINDOW_HEIGHT","LocalPayment","_assetsUrl","_isDebug","_loadingFrameUrl","_authorizationInProgress","_paymentType","_merchantAccountId","isDeferredPaymentTypeOptions","blikOptions","paymentType","hasMissingAddressOption","hasMissingLineItemsOption","items","hasMissingBlikOptions","oneClick","level_0","hasMissingOption","missingAddressOption","missingLineItemOption","fallback","buttonText","recurrent","customerId","_initialize","service","_frameService","startPayment","missingOption","missingError","address","windowOptions","onPaymentStartPromise","serviceId","LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION","amount","bic","line1","streetAddress","line2","extendedAddress","city","locality","region","birthDate","cancelUrl","cancelButtonText","discountAmount","experienceProfile","brandName","customerServiceInstructions","locale","noShipping","shippingAddressRequired","firstName","givenName","fundingSource","intent","lastName","surname","lineItems","merchantOrPartnerCustomerId","payerEmail","email","paymentTypeCountryCode","phone","phoneCountryCode","returnUrl","shippingAmount","LOCAL_PAYMENT_ALREADY_IN_PROGRESS","_startPaymentCallback","_createStartPaymentCallback","paymentResource","_startPaymentOptions","LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED","onPaymentStart","paymentId","paymentToken","LOCAL_PAYMENT_START_PAYMENT_FAILED","LOCAL_PAYMENT_INVALID_PAYMENT_OPTION","queryItems","wasCanceled","LOCAL_PAYMENT_CANCELED","errorcode","btLpToken","_formatTokenizeData","_formatTokenizePayload","LOCAL_PAYMENT_TOKENIZATION_FAILED","closeWindow","_authoriztionInProgress","focusWindow","LOCAL_PAYMENT_WINDOW_CLOSED","LOCAL_PAYMENT_WINDOW_OPEN_FAILED","account","payerInfo","hasTokenizationParams","btLpPaymentId","btLpPayerId","paypalAccount","payerId","PayerID","unilateral","unvettedMerchant","LOCAL_PAYMENT_NOT_ENABLED","Masterpass","_authInProgress","getReturnUrlPrefix","_callbackUrl","isMissingRequiredPayload","oauth_verifier","oauth_token","checkout_resource_url","REQUIRED_OPTIONS_FOR_TOKENIZE","LANDING_FRAME_NAME","POPUP_HEIGHT","POPUP_WIDTH","MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION","MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS","_navigateFrameToLoadingPage","frameOptions","_createFrameOpenHandler","requestToken","originUrl","subtotal","callbackUrl","queryParams","allowedCardTypes","MASTERPASS_VERSION","_closeWindow","MASTERPASS_INVALID_PAYMENT_OPTION","MASTERPASS_FLOW_FAILED","popupBridgeErr","MASTERPASS_POPUP_CLOSED","_tokenizeMasterpass","frameServiceErr","MASTERPASS_POPUP_OPEN_FAILED","mpstatus","MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS","masterpassCard","checkoutResourceUrl","verifierToken","masterpassCards","tokenizeErr","MASTERPASS_ACCOUNT_TOKENIZATION_FAILED","isSupported","MASTERPASS_BROWSER_NOT_SUPPORTED","MASTERPASS_NOT_ENABLED","CARD_TYPE_MAPPINGS","Visa","MasterCard","Discover","UnionPay","Maestro","BRAINTREE_GOOGLE_PAY_MERCHANT_ID","PaymentRequestComponent","enabledPaymentMethods","_componentId","_enabledPaymentMethods","basicCard","_supportedPaymentMethods","_constructDefaultSupportedPaymentMethods","_defaultSupportedPaymentMethods","supportedPaymentMethods","supportedMethods","allowPaymentRequest","PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS","FRAME_CAN_MAKE_REQUESTS","SHIPPING_ADDRESS_CHANGE","shippingAddress","shippingAddressChangeEvent","updateWith","paymentDetails","UPDATE_SHIPPING_ADDRESS","SHIPPING_OPTION_CHANGE","shippingOption","shippingOptionChangeEvent","UPDATE_SHIPPING_OPTION","createSupportedPaymentMethodsConfiguration","PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE","PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED","PAYMENT_REQUEST_INITIALIZED","rawError","_formatTokenizationError","rawPaymentResponse","canMakePayment","unsupportedPaymentMethod","PaymentRequest","SUPPORTED_METHODS","PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD","CAN_MAKE_PAYMENT","_formatCanMakePaymentError","formattedError","PAYMENT_REQUEST_CANCELED","PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED","PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE","PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR","PAYMENT_REQUEST_NOT_COMPLETED","PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED","PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED","PAYPAL_NOT_ENABLED","PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED","PAYPAL_ACCOUNT_TOKENIZATION_FAILED","PAYPAL_FLOW_FAILED","PAYPAL_FLOW_OPTION_REQUIRED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS","PAYPAL_INVALID_PAYMENT_OPTION","PAYPAL_MISSING_REQUIRED_OPTION","PayPalCheckout","REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT","PAYPAL_SDK_PRELOAD_URL","_autoSetDataUserIdToken","autoSetDataUserIdToken","_authorizationInformation","fingerprint","environmentNoNetwork","_setupError","_frameServicePromise","_setupFrameService","frameServicePromise","timeoutRef","createPayment","FLOW_ENDPOINTS","flow","_createPaymentResource","agreementSetup","tokenId","intentFromCreatePayment","offerCredit","_formatPaymentResourceData","updatePayment","_hasMissingOption","REQUIRED_OPTIONS","_verifyConsistentCurrency","_formatUpdatePaymentData","startVaultInitiatedCheckout","missingRequiredParam","_vaultInitiatedCheckoutInProgress","_addModalBackdrop","_waitForVaultInitiatedCheckoutDependencies","frameCommunicationPromise","startVaultInitiatedCheckoutPromise","_constructVaultCheckutUrl","_createFrameServiceCallback","_removeModalBackdrop","optOutOfModalBackdrop","_modalBackdrop","focusVaultInitiatedCheckoutWindow","closeVaultInitiatedCheckoutWindow","tokenizePayment","payerID","paymentID","orderID","orderId","tokenizationError","tokenizeOptions","shouldVault","billingToken","ecToken","shippingOptionsId","vault","creditFinancingOffered","getClientId","clientId","loadPayPalSDK","loadPromise","userIdToken","_paypalScript","components","currency","_attachPreloadPixel","subdomain","preloadOptions","offerPaypalCredit","localeCode","enableShippingAddress","addressOverride","shippingAddressEditable","landingPageType","shippingOptions","requestBillingAgreement","vaultInitiatedCheckoutPaymentMethodToken","shippingAddressOverride","billingAgreementDetails","billingAgreementDescription","_riskCorrelationId","every","required","recipientName","isTokenizationKey","isVaultFlow","billingAgreementToken","shippingOptionId","cobrandedCardLabel","PayPal","tokenizePromise","optionError","PAYPAL_TOKENIZATION_REQUEST_ACTIVE","offerPayLater","_navigateFrameToAuth","canceled","PAYPAL_POPUP_CLOSED","_tokenizePayPal","PAYPAL_POPUP_OPEN_FAILED","ba_token","approvalUrl","useraction","checkout","PreferredPaymentMethods","fetchPreferredPaymentMethods","paypalPreferred","venmoPreferred","sepaErrors","billingAddressOptions","BILLING_ADDRESS_OPTIONS","createMandate","sepa_debit","account_holder_name","accountHolderName","billing_address","country_code","iban","merchant_or_partner_customer_id","mandate_type","mandateType","cancel_url","return_url","merchant_account_id","ccOption","sepaDebitAccount","SEPA_CREATE_MANDATE_FAILED","bankReferenceToken","openPopup","popupName","assetsBaseUrl","popupLocation","centeredPopupDimensions","frameServiceInstance","mandateApproved","customerCanceled","SEPA_CUSTOMER_CANCELED","SEPA_TOKENIZATION_FAILED","cancel","handleApproval","sepa_debit_account","last_4","bank_reference_token","SEPA_TRANSACTION_FAILED","ibanLastFour","mandates","SEPA","_returnUrl","_cancelUrl","createMandateOptions","SEPA_TOKENIZE_MISSING_REQUIRED_OPTION","MANDATE_TYPE_ENUM","includes","mandateResponse","approval","SEPA_INVALID_MANDATE_TYPE","IFRAME_HEIGHT","IFRAME_WIDTH","BaseFramework","_createOptions","setUpEventListeners","THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED","verifyCard","privateOptions","formattedOptions","_checkForVerifyCardError","_verifyCardInProgress","_formatVerifyCardOptions","_formatLookupData","_performLookup","lookup","threeDSecureVersion","_onLookupComplete","initializeChallengeWithLookupResponse","_resetVerificationState","_checkForFrameworkSpecificVerifyCardErrors","_presentChallenge","prepareLookup","_verifyCardPromisePlus","_reloadThreeDSecure","lookupError","analyticsMessage","THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR","THREEDS_LOOKUP_VALIDATION_ERROR","THREEDS_LOOKUP_ERROR","errorOption","THREEDS_AUTHENTICATION_IN_PROGRESS","THREEDS_MISSING_VERIFY_CARD_OPTION","lookupResponse","_lookupPaymentMethod","_handleLookupResponse","liabilityShifted","liabilityShiftPossible","challengeShouldBePresented","acsUrl","_formatAuthResponse","verificationDetails","browserColorDepth","screen","colorDepth","browserJavaEnabled","javaEnabled","browserJavascriptEnabled","browserLanguage","language","browserScreenHeight","browserScreenWidth","browserTimeZone","getTimezoneOffset","deviceChannel","_handleV1AuthResponse","authResponse","auth_response","cancelVerifyCard","THREEDS_NO_VERIFICATION_PAYLOAD","_setupV1Bus","parentURL","bus","authenticationCompleteBaseUrl","pareq","termUrl","md","parentUrl","AUTHENTICATION_COMPLETE","handleAuthResponse","_setupV1Iframe","showLoader","_v1Bus","_setupV1Elements","_v1Iframe","_teardownV1Elements","_onV1Keyup","SongbirdFramework","Bootstrap3ModalFramework","_createV1IframeModalElement","modal","_createCardinalConfigurationOptions","setupOptions","payment","framework","CardinalModalFramework","addCloseButton","cardinalSDKConfig","displayExitButton","LegacyFramework","InlineIframeFramework","legacy","AUTHENTICATION_IFRAME_AVAILABLE","_addV1IframeToPage","_v1Modal","_setupFrameworkSpecificListeners","setCardinalListener","_onInlineSetup","htmlTemplate","hasError","THREEDS_INLINE_IFRAME_DETAILS_INCORRECT","transformV1CustomerBillingAddress","customer","countryCodeAlpha2","_createIframe","_handleAuthResponse","removeFrame","addFrame","modifiedOptions","CUSTOMER_CANCELED_SONGBIRD_MODAL","SONGBIRD_UI_EVENTS","SCA_EXEMPTION_TYPES","_songbirdInitFailed","_clientMetadata","requestedThreeDSecureVersion","originalSetupOptions","_getDfReferenceIdPromisePlus","setupSongbird","_cardinalEvents","extractAddressData","line3","LOOKUP_COMPLETE","CUSTOMER_CANCELED","getDfReferenceId","dfReferenceId","_triggerCardinalBinProcess","clientMetadata","handleSongbirdError","errorType","_removeSongbirdListeners","_songbirdPromise","issuerStartTime","Cardinal","binResults","issuerDeviceDataCollectionTimeElapsed","issuerDeviceDataCollectionResult","Status","transformBillingAddress","additionalInformation","billingPhoneNumber","phoneNumber","billingGivenName","billingSurname","transformShippingAddress","_createV1IframeModal","btn","backdrop","closeHandler","THREEDS_CARDINAL_SDK_CANCELED","_v2SetupFailureReason","_loadCardinalScript","_configureCardinalSdk","setupStartTime","THREEDS_CARDINAL_SDK_SETUP_FAILED","_songbirdSetupTimeoutReference","threeDSConfig","jwt","cardinalAuthenticationJWT","cardinalConfiguration","_createPaymentsSetupCompleteCallback","configure","cardinalDeviceDataCollectionTimeElapsed","_createPaymentsValidatedCallback","paymentSettings","logging","loggingEnabled","level","displayLoading","scriptSource","_getCardinalScriptSource","THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED","gatewayConfig","CARDINAL_SCRIPT_SOURCE","_performJWTValidation","rawCardinalSDKVerificationData","cancelCode","Payment","ExtendedData","ChallengeCancel","formattedResponse","THREEDS_JWT_AUTHENTICATION_FAILED","validatedJwt","ActionCode","ErrorNumber","THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT","THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT","THREEDS_CARDINAL_SDK_BAD_CONFIG","THREEDS_CARDINAL_SDK_BAD_JWT","THREEDS_CARDINAL_SDK_ERROR","ErrorDescription","onLookupComplete","ignoreOnLookupCompleteRequirement","mobilePhoneNumber","requiresUserAuthentication","transactionId","continue","AcsUrl","Payload","OrderDetails","TransactionId","additionalInfo","accountType","challengeRequested","requestedExemptionType","THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID","customFields","dataOnlyRequested","exemptionRequested","requestVisaDAF","cardAdd","cardAddChallengeRequested","merchantName","verifyCardError","THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT","FRAMEWORKS","ThreeDSecure","Framework","_framework","getFramework","gwConfig","THREEDS_NOT_ENABLED","THREEDS_CAN_NOT_USE_TOKENIZATION_KEY","THREEDS_HTTPS_REQUIRED","THREEDS_NOT_ENABLED_FOR_V2","THREEDS_UNSUPPORTED_VERSION","THREEDS_UNRECOGNIZED_VERSION","THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN","UNIONPAY_NOT_ENABLED","HOSTED_FIELDS_FRAME_NAME","UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID","UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED","UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED","UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES","UNIONPAY_EXPIRATION_DATE_INCOMPLETE","UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID","UNIONPAY_ENROLLMENT_NETWORK_ERROR","UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR","UNIONPAY_TOKENIZATION_NETWORK_ERROR","UNIONPAY_MISSING_MOBILE_PHONE_DATA","UNIONPAY_FAILED_TOKENIZATION","fetchCapabilities","_initializeHostedFields","HOSTED_FIELDS_FETCH_CAPABILITIES","enroll","mobile","HOSTED_FIELDS_ENROLL","unionPayEnrollment","mobileCountryCode","mobileNumber","enrollmentId","unionPayEnrollmentId","smsCodeRequired","smsCode","tokenizedCard","HOSTED_FIELDS_TOKENIZE","_hostedFieldsFrame","_hostedFieldsInitializePromise","PLAID_LINK_JS","US_BANK_ACCOUNT_OPTION_REQUIRED","US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS","US_BANK_ACCOUNT_LOGIN_LOAD_FAILED","US_BANK_ACCOUNT_LOGIN_CLOSED","US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE","US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR","US_BANK_ACCOUNT_FAILED_TOKENIZATION","US_BANK_ACCOUNT_NOT_ENABLED","US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED","USBankAccount","TOKENIZE_BANK_DETAILS_MUTATION","createGraphQLMutation","TOKENIZE_BANK_LOGIN_MUTATION","_isTokenizingBankLogin","errorFrom","BRAINTREE_API_ACCESS_RESTRICTED","formatTokenizeResponseFromGraphQL","addLoadListeners","loadHandler","removeLoadListeners","Plaid","errorHandler","formatBillingAddressForGraphQL","zipCode","formatDataForOwnershipType","ownershipType","individualOwner","businessOwner","businessName","mandateText","bankDetails","bankLogin","_tokenizeBankDetails","_tokenizeBankLogin","achMandate","routingNumber","accountNumber","isProduction","plaidConfig","_loadPlaid","plaidLoadErr","clientName","env","product","selectAccount","onExit","onSuccess","publicToken","accountId","account_id","subtype","usBankLogin","existingScript","_plaidScript","VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN","VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND","VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR","VaultManager","DELETE_PAYMENT_METHOD_MUTATION","formatPaymentMethodPayload","formattedPaymentMethod","hasSubscription","fetchPaymentMethods","defaultFirst","paymentMethodsPayload","paymentMethods","deletePaymentMethod","singleUseTokenId","venmo_desktop_1","VENMO_PAYMENT_CONTEXT_STATUS_QUERY","LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY","UPDATE_PAYMENT_CONTEXT_QUERY","LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY","CREATE_PAYMENT_CONTEXT_QUERY","LEGACY_CREATE_PAYMENT_CONTEXT_QUERY","iframer_1","events_1","queries_1","VENMO_DESKTOP_POLLING_INTERVAL","VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION","VenmoDesktop","isHidden","profileId","paymentMethodUsage","shouldUseLegacyQRCodeMutation","frameUrl","apiRequest","alertBox","VENMO_DESKTOP_IFRAME_READY","VENMO_DESKTOP_REQUEST_NEW_QR_CODE","startPolling","launchDesktopFlow","launchDesktopPromiseRejectFunction","removeListeners","VENMO_DESKTOP_CUSTOMER_CANCELED","customerCancelledHandler","VENMO_DESKTOP_UNKNOWN_ERROR","unknownErrorHandler","allowUIToHandleError","updateVenmoDesktopPaymentContext","completedHandler","setAlert","venmoContextId","triggerCompleted","triggerRejected","hideDesktopFlow","VENMO_DESKTOP_CLOSED_FROM_PARENT","displayError","VENMO_DESKTOP_DISPLAY_ERROR","displayQRCode","VENMO_DESKTOP_DISPLAY_QR_CODE","authorize","VENMO_DESKTOP_AUTHORIZE","authorizing","VENMO_DESKTOP_AUTHORIZING","createVenmoDesktopPaymentContext","expiresIn","expiresAt","createdAt","expiredTime","pollForStatusChange","userName","paymentMethodId","lookupVenmoDesktopPaymentContext","newStatus","createPaymentContextFromGraphqlLegacyQRCodeMutation","createVenmoQRCodePaymentContext","venmoQRCodePaymentContext","createPaymentContextFromGraphQL","customerClient","merchantProfileId","createVenmoPaymentContext","venmoPaymentContext","additionalOptions","Venmo","supportsVenmo","VENMO_INVALID_PROFILE_ID","deepLinkReturnUrl","VENMO_INVALID_DEEP_LINK_RETURN_URL","VENMO_NOT_ENABLED","isBrowserSupported","isIosSafari","doesNotSupportWindowOpenInIos","isFacebookOwnedBrowserOnAndroid","DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY","DEFAULT_PROCESS_RESULTS_DELAY","VENMO_APP_OR_MOBILE_AUTH_URL","VENMO_MOBILE_APP_AUTH_ONLY_URL","VENMO_WEB_LOGIN_URL","VENMO_TOKENIZATION_REQUEST_ACTIVE","VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE","VENMO_APP_FAILED","VENMO_APP_CANCELED","VENMO_CANCELED","VENMO_CUSTOMER_CANCELED","VENMO_NETWORK_ERROR","VENMO_DESKTOP_CANCELED","VENMO_TOKENIZATION_CANCELED_BY_MERCHANT","VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED","VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR","VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED","VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED","VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT","VENMO_MOBILE_POLLING_TOKENIZATION_FAILED","VENMO_TOKENIZATION_FAILED","VENMO_ECD_DISABLED","VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT","venmoConstants","getVenmoUrl","useAllowDesktopWebLogin","mobileWebFallBack","inIframe","merchantAllowsDesktopBrowsers","merchantAllowsReturningToNewBrowserTab","merchantAllowsWebviews","isMobileDevice","isMobileDeviceThatSupportsReturnToSameTab","allowDesktopWebLogin","allowDesktop","allowNewBrowserTab","allowWebviews","VENMO_LOGO_SVG","CONTINUE_OR_CANCEL_INSTRUCTIONS","ELEMENT_IDS","backdropHidden","backdropContainer","cancelButton","continueButton","instructions","venmoLogo","venmoUrl","checkForStatusChange","cancelTokenization","checkPaymentContextStatus","extendedPromise","closeBackdrop","retryStartingCount","statusCheckError","getElementStyles","backdropStyles","backdropContainerStyles","cancelButtonStyles","continueButtonStyles","messageStyles","instructionStyles","buildAndStyleElements","backdropStylesElement","backdropDiv","backDropContentContainer","venmoLogoDiv","venmoMessageDiv","instructionsDiv","alreadyRenderedBackdrop","innerText","runWebLogin","setupDesktopWebLogin","desktopWebLogin","createVenmoDesktop","graphqlQueries","DEFAULT_MOBILE_POLLING_INTERVAL","DEFAULT_MOBILE_EXPIRING_THRESHOLD","_allowDesktopWebLogin","_mobileWebFallBack","_allowNewBrowserTab","_allowWebviews","_allowDesktop","_useRedirectForIOS","useRedirectForIOS","_profileId","_displayName","_deepLinkReturnUrl","_ignoreHistoryChanges","ignoreHistoryChanges","_paymentMethodUsage","_shouldUseLegacyFlow","_requireManualReturn","requireManualReturn","_useDesktopQRFlow","_isDesktop","_useAllowDesktopWebLogin","_cannotHaveReturnUrls","_allowAndroidRecreation","allowAndroidRecreation","_maxRetryCount","_collectCustomerBillingAddress","collectCustomerBillingAddress","_collectCustomerShippingAddress","collectCustomerShippingAddress","_isFinalAmount","isFinalAmount","_lineItems","_subTotalAmount","subTotalAmount","_discountAmount","_taxAmount","taxAmount","_shippingAmount","_totalAmount","totalAmount","_shouldCreateVenmoPaymentContext","hasTokenizationResult","venmoDesktopInstance","_venmoDesktopInstance","_mobilePollingInterval","_mobilePollingExpiresThreshold","paymentContextPromise","webLoginPromise","analyticsCategory","_frameServiceInstance","desktopWebErr","_mobilePollingContextEnvironment","_createVenmoPaymentContext","isValidationError","paymentContextResult","promiseErr","getFragmentParameters","parsedParams","decodedKey","resourceId","formatUserName","formatTokenizePayload","formattedPayload","paymentContextId","documentVisibilityChangeEventName","visibilityChange","msHidden","webkitHidden","isIosWebviewInDeepLinkReturnUrlFlow","cancelIfTokenizationInProgress","transactionDetails","venmoConfiguration","transactionDetailsPresent","customerClientChannel","unitTaxAmount","paysheetDetails","refreshIn","_refreshPaymentContextTimeout","_tokenizationInProgress","_venmoPaymentContextStatus","_venmoPaymentContextId","appSwitch","_shouldUseRedirectStrategy","currentUrl","braintreeData","resource_id","_shouldIncludeReturnUrls","braintree_merchant_id","braintree_access_token","braintree_environment","braintree_sdk_data","_hasTokenizationResult","venmoSuccess","venmoError","venmoCancel","_tokenizeForDesktopQRFlow","_tokenizeWebLoginWithRedirect","_tokenizeForMobileWithManualReturn","_tokenizeForMobileWithHashChangeListeners","_removeVisibilityEventListener","_tokenizePromise","_cancelMobilePaymentContext","_cancelVenmoDesktopContext","_checkPaymentContextStatusAndProcessResult","_checkPaymentContextStatus","_queryPaymentContextStatus","retryCount","resultStatus","networkError","_pollForStatusChange","_mobilePollingContextExpiresIn","resultProcessingInProgress","visibilityChangeListenerTimeout","processHashChangeFlowResults","completeFlow","_previousHash","_onHashChangeListener","newURL","_visibilityChangeListener","processResultsDelay","errorCode","_clearFragmentParameters","history","replaceState","pushState","VISA_CHECKOUT_NOT_ENABLED","VISA_CHECKOUT_INIT_OPTIONS_REQUIRED","VISA_CHECKOUT_PAYMENT_REQUIRED","VISA_CHECKOUT_TOKENIZATION","VisaCheckout","transformCardTypes","createInitOptions","visaCheckoutConfiguration","dataLevel","cardBrands","callid","encKey","encPaymentData","visaCheckoutCard","callId","encryptedPaymentData","encryptedKey","visaCheckoutCards","minErrConfig","objectMaxDepth","urlErrorParamsEnabled","errorHandlingConfig","isObject","isDefined","isValidObjectMaxDepth","NaN","isBoolean","isNumber","minErr","ErrorConstructor","regex","errRegExp","paramPrefix","template","templateArgs","sliceArgs","toDebugString","msie","jqLite","angularModule","REGEX_STRING_REGEXP","VALIDITY_STATE_PROPERTY","lowercase","isString","uppercase","ngMinErr","isPrimitive","isBlankObject","forEachSorted","reverseParams","iteratorFn","nextUid","setHashKey","$$hashKey","baseExtend","dst","ii","jj","isDate","isRegExp","isElement","toInt","isNumberNaN","inherit","identity","valueFn","hasCustomToString","isUndefined","isError","isScope","$evalAsync","$watch","isPromiseLike","$inject","TYPED_ARRAY_REGEXP","escapeForRegexp","nodeName_","arrayRemove","stackSource","stackDest","copyRecurse","copyElement","needsRecurse","byteOffset","copied","ArrayBuffer","byteLength","re","lastIndex","copyType","simpleCompare","equals","o1","o2","keySet","t1","createMap","csp","rules","ngCspElement","ngCspAttribute","noUnsafeEval","noInlineStyle","jq","name_","ngAttrPrefixes","array1","array2","startIndex","curryArgs","toJsonReplacer","toJson","pretty","fromJson","ALL_COLONS","timezoneToOffset","timezone","requestedTimezoneOffset","addDateMinutes","minutes","setMinutes","getMinutes","convertTimezoneToLocal","dateTimezoneOffset","startingTag","elemHtml","NODE_TYPE_TEXT","tryDecodeURIComponent","parseKeyValue","splitPoint","encodeUriSegment","encodeUriQuery","pctEncodeSpaces","isAutoBootstrapAllowed","currentScript","HTMLScriptElement","SVGScriptElement","getNamedItem","link","allowAutoBootstrap","angularInit","bootstrap","appElement","hasAttribute","strictDi","ngAttr","getNgAttribute","doBootstrap","injector","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","$apply","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","reload","getTestability","rootElement","SNAKE_CASE_REGEXP","snake_case","separator","bindJQueryFired","UNSAFE_restoreLegacyJqLiteXHTMLReplacement","JQLite","legacyXHTMLReplacement","assertArg","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getBlockNodes","blockNodes","endNode","NODE_TYPE_ELEMENT","NODE_TYPE_COMMENT","NODE_TYPE_DOCUMENT","NODE_TYPE_DOCUMENT_FRAGMENT","shallowCopy","seen","serializeObject","full","major","minor","dot","codeName","jqCache","jqId","DASH_LOWERCASE_REGEXP","MS_HACK_REGEXP","MOUSE_EVENT_MAP","jqLiteMinErr","fnCamelCaseReplace","kebabToCamel","SINGLE_TAG_REGEXP","HTML_REGEXP","TAG_NAME_REGEXP","XHTML_TAG_REGEXP","wrapMapIE9","wrapMapValueClosing","wrapMapValue","jqLiteIsTextNode","jqLiteAcceptsData","jqLiteBuildFragment","finalHtml","jqLiteContains","Node","argIsString","jqLiteAddNodes","jqLiteReady","jqLiteClone","jqLiteDealoc","onlyDescendants","removeIfEmptyData","expandoId","ng339","expandoStore","jqLiteOff","unsupported","jqLiteExpandoStore","removeHandler","listenerFns","jqLiteRemoveData","createIfNecessary","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","jqLiteRemoveClass","cssClasses","existingClasses","newClasses","jqLiteAddClass","jqLiteController","jqLiteInheritedData","names","jqLiteEmpty","jqLiteRemove","JQLitePrototype","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","ALIASED_ATTR","getBooleanAttrName","booleanAttr","defaultHandlerWrapper","specialMouseHandlerWrapper","$$jqLiteProvider","$get","classes","hashKey","nextUidFn","objType","inheritedData","isolateScope","controller","cssKebabToCamel","lowercasedName","isBooleanAttr","$dv","multiple","arg1","arg2","nodeCount","eventHandler","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","handlerWrapper","specialHandlerWrapper","createEventHandler","addHandler","noEventListener","onFn","replaceNode","child","wrapNode","wrapper","newElement","condition","classCondition","nextElementSibling","extraParameters","dummyEvent","eventFnsCopy","handlerArgs","arg3","nanKey","NgMapShim","_keys","_values","_lastKey","_lastIndex","_idx","_transformKey","delete","NgMap","$$MapProvider","ARROW_ARG","FN_ARGS","FN_ARG_SPLIT","FN_ARG","STRIP_COMMENTS","$injectorMinErr","stringifyFn","extractArgs","fnText","modulesToLoad","INSTANTIATING","providerSuffix","loadedModules","providerCache","provider","supportObject","$injector","instantiate","constant","instanceCache","decorator","serviceName","decorFn","origProvider","providerInjector","orig$get","origInstance","instanceInjector","$delegate","createInternalInjector","caller","protoInstanceInjector","runBlocks","loadModules","loadNewModules","mods","provider_","enforceReturnValue","factoryFn","enforce","moduleFn","requires","_runBlocks","runInvokeQueue","_invokeQueue","_configBlocks","invokeArgs","getService","injectionArgs","locals","$$annotate","$$ngIsClass","isClass","Type","ctor","annotate","$AnchorScrollProvider","autoScrollingEnabled","disableAutoScrolling","$window","$location","$rootScope","scroll","yOffset","getYOffset","elemTop","scrollBy","elm","newVal","oldVal","action","anonFn","underscore","$animateMinErr","NG_ANIMATE_CLASSNAME","mergeClasses","prepareAnimateOptions","$$CoreAnimateJsProvider","$$CoreAnimateQueueProvider","postDigestQueue","postDigestElements","$$AnimateRunner","pin","domOperation","from","classesAdded","updateData","classesRemoved","$$postDigest","handleCSSClassChanges","addRemoveClassesPostDigest","runner","changed","existing","klass","splitClasses","toAdd","toRemove","$AnimateProvider","classNameFilter","customFilter","$$registeredAnimations","register","filterFn","expression","$$animateQueue","domInsert","parentElement","afterElement","afterNode","extractElementNode","previousElementSibling","enter","move","leave","addclass","setClass","tempClasses","$$AnimateAsyncRunFactoryProvider","$$rAF","waitQueue","waitForTick","passed","$$AnimateRunnerFactoryProvider","$q","$sniffer","$$animateAsyncRun","$$isDocumentHidden","$timeout","AnimateRunner","setHost","rafTick","_doneCallbacks","_tick","timeoutTick","chain","runners","getPromise","resolveHandler","rejectHandler","pause","resume","_resolve","$CoreAnimateCssProvider","initialOptions","$$prepared","cleanupStyles","applyAnimationContents","Browser","$log","$$taskTrackerFactory","pendingDeferIds","taskTracker","isMock","$$completeOutstandingRequest","completeTask","$$incOutstandingRequestCount","incTaskCount","notifyWhenNoOutstandingRequests","notifyWhenNoPendingTasks","cachedState","lastHistoryState","lastBrowserUrl","baseElement","pendingLocation","getCurrentState","cacheState","sameState","urlResolve","sameBase","stripHash","getHash","trimEmptyHash","urlChangeListeners","urlChangeInit","cacheStateAndFireUrlChange","fireStateOrUrlChange","lastCachedState","prevLastHistoryState","onUrlChange","$$applicationDestroyed","$$checkUrlChange","baseHref","taskType","timeoutId","DEFAULT_TASK_TYPE","deferId","$BrowserProvider","$document","$CacheFactoryProvider","caches","cacheFactory","cacheId","stats","capacity","MAX_VALUE","lruHash","freshEnd","staleEnd","put","refresh","lruEntry","removeAll","info","entry","nextEntry","prevEntry","$TemplateCacheProvider","$cacheFactory","$compileMinErr","_UNINITIALIZED_VALUE","$CompileProvider","$$sanitizeUriProvider","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","makeMap","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","bindingCache","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","optional","attrName","parseDirectiveBindings","directive","bindToController","registerDirective","directiveFactory","assertValidDirectiveName","$exceptionHandler","directives","priority","require","getDirectiveRequire","restrict","getDirectiveRestrict","$$moduleName","registerComponent","makeInjectable","tElement","tAttrs","$element","$attrs","templateUrl","ddo","controllerAs","identifierForController","transclude","aHrefSanitizationTrustedUrlList","regexp","imgSrcSanitizationTrustedUrlList","strictComponentBindingsEnabled","TTL","onChangesTtl","commentDirectivesEnabledConfig","commentDirectivesEnabled","cssClassDirectivesEnabledConfig","cssClassDirectivesEnabled","PROP_CONTEXTS","addPropertySecurityContext","elementName","propertyName","registerContext","SCE_CONTEXTS","HTML","CSS","URL","MEDIA_URL","RESOURCE_URL","$interpolate","$templateRequest","$parse","$controller","$sce","$animate","onChangesQueue","SIMPLE_ATTR_NAME","specialAttrHolder","flushOnChangesQueue","sanitizeSrcset","invokeType","trimmedSrcset","rawUris","nbrUrisWith2parts","innerIdx","getTrustedMediaUrl","lastTuple","Attributes","attributesToCopy","$attr","$$element","safeAddClass","$normalize","directiveNormalize","$addClass","classVal","$removeClass","$updateClass","oldClasses","tokenDifference","$set","writeAttr","booleanKey","aliasedKey","observer","removeNamedItem","setNamedItem","setSpecialAttr","$$observers","$observe","$$inter","startSymbol","endSymbol","denormalizeTemplate","NG_PREFIX_BINDING","MULTI_ELEMENT_DIR_RE","$$addBindingInfo","binding","$$addBindingClass","$$addScopeInfo","isolated","noTemplate","dataName","$$addScopeClass","$$createComment","comment","createComment","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","compositeLinkFn","compileNodes","cloneConnectFn","needsNewScope","$parent","$new","$linkNode","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","wrapTemplate","controllerName","nodeList","$rootElement","nodeLinkFn","childLinkFn","linkFnFound","nodeLinkFnFound","linkFns","notLiveList","mergeConsecutiveTextNodes","collectDirectives","applyDirectivesToNode","terminal","transcludeOnThisElement","templateOnThisElement","childScope","stableNodeList","nodeListLength","createBoundTranscludeFn","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","attrsMap","addDirective","nName","ngPrefixMatch","nAttrs","multiElementMatch","attrStartName","attrEndName","isNgAttr","isNgProp","isNgEvent","PREFIX_REGEXP","directiveIsMultiElement","addPropertyDirective","addEventDirective","addAttrInterpolateDirective","animVal","interpolateFn","templateNode","templateNodeParent","hasCompileParent","expressions","addTextInterpolateDirective","collectCommentDirectives","byPriority","groupScan","attrStart","attrEnd","groupElementsLinkFnWrapper","linkFn","compilationGenerator","eager","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","$template","directiveValue","terminalPriority","newScopeDirective","controllerDirectives","newIsolateScopeDirective","templateDirective","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","hasElementTranscludeDirective","$compileNode","replaceDirective","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","$$start","$$end","assertNoDuplicate","$$tlb","candidateDirective","scanningIndex","slots","slotMap","filledSlots","elementSelector","filled","slotCompileNodes","$$isolateScope","$$newScope","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","$$originalDirective","addLinkFns","pre","post","cloneAndAnnotateFn","linkNode","controllerScope","elementControllers","scopeBindingInfo","cloneAttachFn","scopeToChild","slotTranscludeFn","isSlotFilled","controllerKey","$scope","$transclude","controllerInstance","setupControllers","$$isolateBindings","initializeDirectiveBindings","removeWatches","$on","controllerDirective","$$bindings","bindingInfo","getControllers","$onChanges","initialChanges","$onInit","$doCheck","$onDestroy","invokeLinkFn","$postLink","inheritType","newScope","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","linkQueue","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","tempTemplateAttrs","childBoundTranscludeFn","beforeTemplateLinkNode","linkRootElement","$$destroyed","ignoreChildLinkFn","previousDirective","wrapModuleNameIfDefined","moduleName","sanitizeSrcsetPropertyValue","propName","trustedContext","propNormalizedName","getTrustedPropContext","sanitizer","getTrusted","ngPropGetter","ngPropWatch","applyPropValue","propValue","createEventDirective","attrNormalizedName","getTrustedAttrContext","mustHaveExpression","allOrNothing","$$scope","oldValue","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","annotation","strictBindingsCheck","changes","removeWatchCollection","recordChanges","previousValue","triggerOnChangesHook","SimpleChange","lastValue","parentGet","parentSet","removeWatch","literal","parentValueWatch","parentValue","$stateful","$watchCollection","isLiteral","initialValue","previous","isFirstChange","SPECIAL_CHARS_REGEXP","str1","str2","tokens1","tokens2","outer","jqNodes","$controllerMinErr","CNTRL_REG","ident","$ControllerProvider","later","bindFnToScope","lastInstance","controllerPrototype","addIdentifier","$DocumentProvider","$$IsDocumentHiddenProvider","changeListener","$ExceptionHandlerProvider","cause","$$ForceReflowProvider","domNode","APPLICATION_JSON","CONTENT_TYPE_APPLICATION_JSON","JSON_START","JSON_ENDS","JSON_PROTECTION_PREFIX","$httpMinErr","serializeValue","toISOString","$HttpParamSerializerProvider","$HttpParamSerializerJQLikeProvider","toSerialize","topLevel","defaultHttpResponseTransform","tempData","hasJsonContentType","jsonStart","parseHeaders","fillInParsed","line","headerVal","headersGetter","headersObj","transformData","$HttpProvider","transformResponse","transformRequest","isBlob","isFormData","common","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","jsonpCallbackParam","useApplyAsync","interceptorFactories","interceptors","xsrfTrustedOrigins","origins","$browser","$httpBackend","$$cookieReader","defaultCache","reversedInterceptors","interceptorFactory","parsedAllowedOriginUrls","urlIsAllowedOrigin","requestUrl","parsedUrl","urlsAreSameOrigin","$http","requestConfig","defHeaderName","lowercaseDefHeaderName","reqHeaderName","defHeaders","reqHeaders","defaultHeadersIteration","headerContent","processedHeaders","headerFn","executeHeaderFns","mergeHeaders","requestInterceptors","responseInterceptors","interceptor","responseError","chainInterceptors","reqData","withCredentials","cachedResp","isJsonp","getTrustedResourceUrl","serializedParams","buildUrl","cbKey","sanitizeJsonpCallbackParam","pendingRequests","removePendingReq","resolvePromiseWithResult","resolvePromise","xsrfValue","createApplyHandlers","eventHandlers","uploadEventHandlers","applyHandlers","callEventHandler","$applyAsync","$$phase","headersString","xhrStatus","resolveHttpPromise","sendReq","finally","thenFn","rejectFn","resp","createShortMethods","createShortMethodsWithData","$xhrFactoryProvider","$HttpBackendProvider","$jsonpCallbacks","$xhrFactory","createXhr","$browserDefer","rawDocument","callbackPath","createCallback","jsonpDone","jsonpReq","getResponse","completeRequest","removeCallback","abortedByTimeout","requestAborted","requestTimeout","upload","timeoutRequest","$$timeoutId","wasCalled","createHttpBackend","$interpolateMinErr","$InterpolateProvider","startSymbolLength","endSymbolLength","escapedStartRegexp","escapedEndRegexp","unescapeText","constantWatchDelegate","objectEquality","constantInterp","unwatch","contextAllowsConcatenation","unescapedText","exp","$$watchDelegate","endIndex","parseFns","singleExpression","textLength","expressionPositions","interr","compute","throwNoconcat","$watchGroup","oldValues","currValue","$intervalMinErr","$IntervalProvider","$$intervalFactory","intervals","clearIntervalFn","$$intervalId","markQExceptionHandled","$$IntervalFactoryProvider","$$q","setIntervalFn","invokeApply","hasParams","iteration","skipApply","$jsonpCallbacksProvider","callbackMap","callbackId","$$counter","PATH_MATCH","DEFAULT_PORTS","$locationMinErr","normalizePath","pathValue","searchValue","hashValue","search","arrayValue","segments","encodePath","parseAbsoluteUrl","absoluteUrl","locationObj","$$protocol","$$host","$$port","port","DOUBLE_SLASH_REGEX","parseAppUrl","html5Mode","prefixed","pathname","$$path","decodePath","$$search","$$hash","startsWith","stripBaseUrl","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","pathUrl","$$compose","$$normalizeUrl","$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutHashUrl","withoutBaseUrl","firstPathSegmentMatch","windowsFilePathExp","removeWindowsDriveName","LocationHashbangInHtml5Url","locationPrototype","$$absUrl","$$replace","$$url","$$urlUpdatedByLocation","absUrl","locationGetter","locationGetterSetter","paramValue","preprocess","$LocationProvider","requireBase","rewriteLinks","LocationMode","initialUrl","lastIndexOf","stripFile","$$state","IGNORE_URI_REGEXP","setBrowserUrlWithFallback","oldUrl","oldState","absHref","initializing","newUrl","newState","$broadcast","afterLocationChange","$digest","currentReplace","urlOrStateChanged","$LogProvider","debugEnabled","formatStackTrace","consoleLog","logFn","sourceURL","formatError","Location","$parseMinErr","objectValueOf","getStringValue","OPERATORS","ESCAPE","Lexer","lex","readString","peek","readNumber","isIdentifierStart","peekMultichar","readIdent","isWhitespace","ch2","ch3","op1","op2","op3","throwError","chars","codePointAt","isValidIdentifierStart","isIdentifierContinue","isValidIdentifierContinue","cp","cp1","cp2","isExpOperator","colStr","peekCh","quote","rawString","AST","lexer","ifDefined","plusFn","Program","ExpressionStatement","AssignmentExpression","ConditionalExpression","LogicalExpression","BinaryExpression","UnaryExpression","CallExpression","MemberExpression","Identifier","Literal","ArrayExpression","Property","ObjectExpression","ThisExpression","LocalsExpression","NGValueParameter","ast","program","expressionStatement","expect","filterChain","assignment","ternary","isAssignable","alternate","consequent","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","arrayDeclaration","selfReferential","literals","callee","parseArguments","baseExpression","peekToken","e1","e2","e3","e4","peekAhead","PURITY_ABSOLUTE","PURITY_RELATIVE","findConstantAndWatchExpressions","$filter","parentIsPure","allConstants","argsToWatch","isStatelessFilter","astIsPure","isPure","toWatch","filterName","isStateless","getInputs","lastExpression","assignableAST","ASTCompiler","ASTInterpreter","Parser","astCompiler","getValueOf","$ParseProvider","identStart","identContinue","addLiteral","literalName","literalValue","setIdentifierFns","identifierStart","identifierContinue","$parseOptions","$$getAst","getAst","interceptorFn","parsedExpression","cacheKey","addWatchDelegate","addInterceptor","expressionInputDirtyCheck","oldValueOfValue","compareObjectIdentity","inputsWatchDelegate","prettyPrintExpression","lastResult","inputExpressions","inputs","oldInputValueOf","newInputValue","oldInputValueOfValues","oldInputValues","oneTimeWatchDelegate","isDone","isAllDefined","$$intercepted","$$interceptor","useInputs","oneTimeWatch","unwatchIfDone","allDefined","oneTime","chainedInterceptor","$$pure","$QProvider","errorOnUnhandledRejections","qFactory","$$QProvider","nextTick","exceptionHandler","$qMinErr","queueSize","checkQueue","rejectPromise","notifyPromise","processChecks","toCheck","isStateExceptionHandled","markQStateExceptionHandled","scheduleProcessQueue","pending","processScheduled","$$passToExceptionHandler","processQueue","$$reject","$$resolve","doReject","handleCallback","resolver","callbackOutput","errback","progressBack","$Q","promises","counter","pur","$$RAFProvider","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","supported","$RootScopeProvider","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","destroyChildScope","$event","currentScope","cleanUpScope","$$childHead","$$nextSibling","$$prevSibling","$$childTail","$root","$$watchers","Scope","$id","$$suspended","$$listeners","$$listenerCount","$$watchersCount","isolate","$$ChildScope","ChildScope","createChildScopeClass","watchExp","watcher","initWatchVal","$$digestWatchIndex","incrementWatchersCount","watchExpressions","newValues","deregisterFns","changeReactionScheduled","firstRun","shouldCall","watchGroupAction","unwatchFn","$watchCollectionInterceptor","veryOldValue","trackVeryOldValue","changeDetected","changeDetector","internalArray","internalObject","initRun","oldLength","newLength","newItem","oldItem","watch","watchers","dirty","logIdx","asyncTask","ttl","asyncQueue","watchLog","beginPhase","flushApplyAsync","asyncQueuePosition","traverseScopesLoop","clearPhase","postDigestQueuePosition","$suspend","$isSuspended","$resume","$destroy","decrementListenerCount","$eval","applyAsyncQueue","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","phase","$$SanitizeUriProvider","uri","isMediaUrl","normalizedVal","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","getHasOwnProperty","isNull","nonComputedMember","notNull","member","stringEscapeFn","stringEscapeRegex","rhs","lhs","isConstant","$sceMinErr","JS","UNDERSCORE_LOWERCASE_REGEXP","snakeToCamel","adjustMatchers","adjustedMatchers","adjustMatcher","$SceDelegateProvider","trustedResourceUrlList","bannedResourceUrlList","$$sanitizeUri","htmlSanitizer","matchUrl","baseURI","baseUrlParsingNode","getBaseUrl","urlIsSameOriginAsBaseUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","trustedValueHolderBase","byType","trustAs","Constructor","maybeTrusted","allowed","isResourceUrlAllowedByPolicy","$SceProvider","$sceDelegate","sce","isEnabled","parseAs","enumValue","lName","$SnifferProvider","eventSupport","hasHistoryPushState","nw","chrome","app","runtime","android","boxee","bodyStyle","transitions","animations","hasEvent","divElm","$$TaskTrackerFactoryProvider","TaskTracker","taskCounts","taskCallbacks","ALL_TASKS_TYPE","getLastCallback","cbInfo","getLastCallbackForType","decTaskCount","countForType","countForAll","nextCb","getNextCallback","$templateRequestMinErr","$TemplateRequestProvider","httpOptions","$templateCache","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","transformer","$$TestabilityProvider","testability","opt_exactMatch","dataBinding","bindingName","prefixes","$timeoutMinErr","$TimeoutProvider","deferreds","urlParsingNode","ipv6InBrackets","url1","url2","$WindowProvider","$$CookieReader","lastCookies","lastCookieString","safeDecodeURIComponent","cookieArray","cookie","currentCookieString","safeGetCookie","$$CookieReaderProvider","$FilterProvider","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","anyPropertyKey","predicateFn","matchAgainstAnyProp","getTypeForFilter","shouldMatchPrimitives","actual","expected","deepCompare","createPredicateFn","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","MAX_DIGITS","DECIMAL_SEP","ZERO_CHAR","$locale","formats","NUMBER_FORMATS","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","currencySymbolRe","formatNumber","GROUP_SEP","groupSep","decimalSep","parsedNumber","isInfinity","isZero","numStr","abs","formattedText","digits","numberOfIntegerDigits","zeros","exponent","minFrac","fractionLen","roundAt","digit","carry","reduceRight","roundNumber","integerLen","decimals","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","negWrap","neg","dateGetter","dateStrGetter","shortForm","standAlone","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","datetime","firstThurs","getFullYear","getMonth","getDate","eraGetter","ERAS","DATE_FORMATS","yyyy","yy","MMMM","MMM","MM","LLLL","dd","HH","hh","mm","ss","sss","EEEE","EEE","getHours","AMPMS","Z","zone","paddedZone","ww","GG","GGG","GGGG","ERANAMES","DATE_FORMATS_SPLIT","NUMBER_STRING","R_ISO8601_STR","format","DATETIME_FORMATS","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","ms","jsonStringToDate","spacing","limit","begin","Infinity","sliceFn","sortPredicate","reverseOrder","compareFn","predicates","predicate","descending","defaultCompare","compareValues","tieBreaker","predicateValues","objectValue","getPredicateValue","v1","v2","type1","type2","value1","value2","ngDirective","htmlAnchorDirective","xlinkHref","ngAttributeAliasDirectives","normalized","defaultLinkFn","ngModel","htmlAttr","ngPattern","nullFormCtrl","$addControl","$getControls","$$renameControl","control","$name","$removeControl","$setValidity","$setDirty","$setPristine","$setSubmitted","$$setSubmitted","PENDING_CLASS","SUBMITTED_CLASS","FormController","$$controls","$error","$$success","$pending","ngForm","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","$$animate","setupValidity","$rollbackViewValue","$commitViewValue","newName","oldName","PRISTINE_CLASS","DIRTY_CLASS","$setUntouched","rootForm","addSetValidityMethod","clazz","unset","formDirectiveFactory","isNgForm","formElement","VALID_CLASS","nameAttr","ctrls","handleFormSubmission","getSetter","formDirective","ngFormDirective","$$classCache","INVALID_CLASS","cachedToggleClass","ctrl","switchValue","toggleValidationCss","validationErrorKey","combinedState","createAndSet","isObjectEmpty","unsetAndCleanup","ISO_DATE_REGEXP","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","PARTIAL_VALIDATION_EVENTS","PARTIAL_VALIDATION_TYPES","inputType","baseInputType","stringBasedInputType","createDateInputType","createDateParser","isoWeek","existingDate","week","hours","seconds","milliseconds","addDays","getSeconds","getMilliseconds","parsedMinVal","badInputChecker","numberFormatterParser","ngMin","minVal","parseNumberAttrVal","$validators","modelValue","viewValue","$isEmpty","$validate","ngMax","maxVal","parsedMaxVal","ngStep","stepVal","parsedStepVal","isValidForStep","doTrim","ngTrim","ev","$setViewValue","$render","$viewValue","supportsRange","$$hasNativeValidators","validity","hasMinAttr","hasMaxAttr","hasStepAttr","originalRender","rangeUnderflow","rangeOverflow","setInitialValueAndObserver","$modelValue","elVal","stepMismatch","htmlAttrName","changeFn","trueValue","parseConstantExpr","ngTrueValue","falseValue","ngFalseValue","$formatters","$parsers","composing","deferListener","origValue","origBadInput","badInput","origTypeMismatch","typeMismatch","mapping","iso","previousDate","part","parseDate","previousTimezone","isTimeType","parseDateAndConvertTimeZoneToLocal","$$parserName","ngModelMinErr","isValidDate","$options","getOption","targetFormat","formatted","formatter","parseObservedDateValue","parsedDate","parserName","isNumberInteger","countDecimals","numString","decimalSymbolIndex","stepBase","isNonIntegerValue","isNonIntegerStepBase","isNonIntegerStep","valueDecimals","stepBaseDecimals","stepDecimals","decimalCount","multiplier","parseFn","inputDirective","hiddenInputBrowserCacheDirective","valueProperty","CONSTANT_VALUE_REGEXP","ngValueDirective","updateElementValue","tplAttr","ngValue","ngBindDirective","$compile","templateElement","ngBind","ngBindTemplateDirective","ngBindTemplate","ngBindHtmlDirective","ngBindHtmlGetter","ngBindHtml","ngBindHtmlWatch","getTrustedHtml","ngChangeDirective","$viewChangeListeners","ngChange","classDirective","indexWatchExpression","oldClassString","classCounts","oldModulo","digestClassCounts","classArray","classesToUpdate","$index","newModulo","classString","removeClasses","toClassString","newClassString","oldClassArray","newClassArray","toRemoveArray","arrayDifference","toAddArray","toRemoveString","toAddString","updateClasses","classValue","ngClassDirective","ngClassOddDirective","ngClassEvenDirective","ngCloakDirective","ngControllerDirective","ngEventDirectives","forceAsyncEvents","forceAsync","ngIfDirective","previousElements","ngIf","ngIncludeDirective","$anchorScroll","srcExp","ngInclude","onloadExp","autoScrollExp","autoscroll","previousElement","currentElement","changeCounter","cleanupLastIncludeContent","afterAnimation","thisChangeId","ngIncludeFillContentDirective","ngInitDirective","ngInit","ngListDirective","ngList","trimValues","UNTOUCHED_CLASS","TOUCHED_CLASS","EMPTY_CLASS","NOT_EMPTY_CLASS","NgModelController","$$rawModelValue","$asyncValidators","$untouched","$touched","defaultModelOptions","$$updateEvents","$$updateEventHandler","$$parsedNgModel","$$parsedNgModelAssign","$$ngModelGet","$$ngModelSet","$$pendingDebounce","$$parserValid","$$currentValidationRunId","$$rootScope","$$attr","$$timeout","$$exceptionHandler","$$setModelValue","$$initGetterSetters","invokeModelGetter","invokeModelSetter","$$$p","$$updateEmptyClasses","$setTouched","$$lastCommittedViewValue","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","doneCallback","validatorPromises","localValidationRunId","errorKey","setValidity","processParseErrors","syncValidatorsValid","validator","processSyncValidators","validationDone","$$parseAndValidate","writeToModelIfNeeded","$$debounceViewValueCommit","debounceDelay","$overrideModelOptions","$$setUpdateOnEvents","$processModelValue","$$format","formatters","ngModelDirective","modelCtrl","formCtrl","optionsCtrl","setTouched","DEFAULT_REGEXP","ModelOptions","$$options","inheritAll","updateOnDefault","updateOn","debounce","getterSetter","ngModelOptionsDirective","NgModelOptionsController","$$attrs","parentOptions","parentCtrl","modelOptionsDefinition","ngModelOptions","ngNonBindableDirective","ngOptionsMinErr","NG_OPTIONS_REGEXP","ngOptionsDirective","optionTemplate","optGroupTemplate","selectElement","registerOption","selectCtrl","ngModelCtrl","hasEmptyOption","emptyOption","providedEmptyOption","ngOptions","optionsExp","valueName","keyName","selectAs","trackBy","viewValueFn","trackByFn","getTrackByValueFn","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","Option","selectValue","group","getOptionValuesKeys","optionValues","optionValuesKeys","itemKey","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","parseOptionsExpression","listFragment","addOptionElement","optionElement","updateOptionElement","getAndUpdateSelectedOption","generateUnknownOptionValue","writeValue","selectedOptions","readValue","selectedValues","selections","selectedOption","removeUnknownOption","selectUnknownOrEmptyOption","unselectEmptyOption","optionScope","optionEl","needsRerender","$isEmptyOptionSelected","groupElementMap","groupElement","nextValue","ngPluralizeDirective","BRACE","IS_WHEN","lastCount","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","updateElementText","newText","attributeName","tmpMatch","whenKey","countIsNaN","pluralCat","whenExpFn","ngRefMinErr","ngRefDirective","ngRef","refValue","ngRefRead","ngRepeatDirective","NG_REMOVED","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","getBlockStart","getBlockEnd","trackByIdArrayFn","trackByIdObjFn","ngRepeat","ngRepeatEndComment","aliasAs","trackByExp","trackByIdExpFn","hashFnLocals","trackByExpGetter","lastBlockMap","nextNode","collectionLength","trackById","trackByIdFn","collectionKeys","nextBlockOrder","previousNode","nextBlockMap","blockKey","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","ngShowDirective","ngShow","ngHideDirective","ngHide","ngStyleDirective","ngStyle","newStyles","oldStyles","ngSwitchDirective","cases","ngSwitchController","watchExpr","ngSwitch","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","selectedTransclude","caseElement","selectedScope","anchor","ngSwitchWhenDirective","ngSwitchWhen","ngSwitchWhenSeparator","whenCase","ngSwitchDefaultDirective","ngTranscludeMinErr","ngTranscludeDirective","fallbackLinkFn","ngTransclude","ngTranscludeSlot","useFallbackContent","notWhitespace","scriptDirective","noopNgModelController","setOptionSelectedStatus","SelectController","optionsMap","unknownOption","renderUnknownOption","unknownVal","updateUnknownOption","selectEmptyOption","realVal","hasOption","currentlySelectedOption","hashedVal","addOption","scheduleRender","removeOption","$hasEmptyOption","$isUnknownOptionSelected","renderScheduled","updateScheduled","scheduleViewValueUpdate","renderAfter","optionAttrs","interpolateValueFn","interpolateTextFn","removal","previouslySelected","removeValue","selectDirective","shouldBeSelected","lastView","lastViewRef","optionDirective","selectCtrlName","requiredDirective","ngRequired","patternDirective","tElm","tAttr","patternExp","attrVal","parsePatternAttr","oldRegexp","maxlengthDirective","ngMaxlength","maxlengthParsed","parseLength","minlengthDirective","ngMinlength","minlengthParsed","intVal","originalCleanData","jqName","bindJQuery","ensure","$$minErr","configFn","invokeQueue","configBlocks","invokeLater","moduleInstance","invokeLaterAndSetModuleName","insertMethod","recipeName","factoryFunction","setupModuleLoader","textarea","form","ngClass","ngClassEven","ngClassOdd","ngCloak","ngController","ngNonBindable","ngPluralize","ngSwitchDefault","$animateCss","$$animateJs","$$forceReflow","$interval","$httpParamSerializer","$httpParamSerializerJQLike","$$testability","$$jqLite","$$Map","angularVersion","publishExternalAPI","PLURAL_CATEGORY","opt_precision","vf","getDecimals","getVF","$$csp","Timeout","clearFn","_id","_clearFn","unref","ref","msecs","_idleTimeoutId","_idleTimeout","unenroll","_unrefActive","_onTimeout","clearImmediate","registerImmediate","messagePrefix","onGlobalMessage","nextHandle","tasksByHandle","currentlyRunningATask","attachTo","runIfPresent","importScripts","postMessageIsAsynchronous","oldOnMessage","onmessage","canUsePostMessage","MessageChannel","port1","port2","task","cachedSetTimeout","cachedClearTimeout","defaultSetTimout","defaultClearTimeout","runTimeout","fun","currentQueue","draining","queueIndex","cleanUpNextTick","drainQueue","marker","runClearTimeout","Item","browser","argv","versions","addListener","removeListener","removeAllListeners","prependListener","prependOnceListener","cwd","chdir","umask","Validator","_classCallCheck","_defineProperty","fieldNames","_Array$from","getFormField","_addError","messages","_removeError","fieldName","validateEmailability","qty","generalErrorMsg","transactionErrors","paymentTransactionErrorMessage","paymentGeneralErrorMessage","paymentGeneralError","hostedFieldsErrors","entries","_error2","_slicedToArray","fieldInfo","_messageForBadData","_error","paymentInitializationErrorMessage","validateAddress","validateEmail","validateQuantity","validateNotEmpty","isFormValid","bad_email","invalid_email","empty_field","silly_address","wrong_quantity","bad_data","aForm","PriceCalculator","_createClass","basePrice","nextPrice","normalCount","cheeperCount","price","toFixed","threeDSecureInstance","clientCallbacks","hostedFieldsInstance","onPaymentGeneralError","getPrice","onVerifyCardError","onPaymentFormErrors","BraintreeClient","_ref","_doSetup","onInitializationError","createHostedFields","createThreeDSecure","_doCreateThreeDSecure","threeDSecureInstanceReceived","bindFormSubmit","PaymentsClient","processing","showPayment","explicitActive","setPrices","getPriceFor","isExplicitActive","setForm","isErrorFor","errorsFor","setPrice","setCardsType","setPayments","submitTransaction","handleInitializationError","handleVerifyCardError","handlePaymentMethodErrors","handlePaymentFormErrors","onDeviceDataReady","setDeviceData","loadInitializationError","loadVerifyCardError","gtag","event_category","event_label","loadPaymentMethodError","orderValid","loadPaymentFormErrors","toggleCards","checkShippingData","blockShipping","submitPayment","successfullPayment","loadTransactionError","responseJSON","changeZIndex","stopPropag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AO,iBAAiBu1H,UAAU,UAAU,iBAAO,CACzDU,SAAU,IACVvZ,KAAI,SAACltG,EAAO5J,EAAM8d,GAChB,OAAO9d,EAAK+iB,GAAG,SAAS,SAACla,GACvBA,EAAE+a,iBACFwhB,SAAWtnB,EAAMmnG,OAEjBx+E,EAAE,cAAcnP,QACd,CACErD,UAAWwS,EAAErB,UAAUhB,SAAS94B,KAElC,KACA,WACEm7B,EAAE3oB,EAAMvO,OAAOA,QACfu1K,KAAK,QAAShnK,EAAMqF,MAAO,CACzB4hK,eAAgB,OAChBC,YAAa,SAEjB,GAEJ,GACF,EACD,G","file":"js/application-[fullhash].js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","/*!\n * jQuery JavaScript Library v3.7.1\n * https://jquery.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2023-08-28T13:37Z\n */\n(function (global, factory) {\n \"use strict\";\n\n if (typeof module === \"object\" && typeof module.exports === \"object\") {\n // For CommonJS and CommonJS-like environments where a proper `window`\n // is present, execute the factory and get jQuery.\n // For environments that do not have a `window` with a `document`\n // (such as Node.js), expose a factory as module.exports.\n // This accentuates the need for the creation of a real `window`.\n // e.g. var jQuery = require(\"jquery\")(window);\n // See ticket trac-14549 for more info.\n module.exports = global.document ? factory(global, true) : function (w) {\n if (!w.document) {\n throw new Error(\"jQuery requires a window with a document\");\n }\n return factory(w);\n };\n } else {\n factory(global);\n }\n\n // Pass this if window is not defined yet\n})(typeof window !== \"undefined\" ? window : this, function (window, noGlobal) {\n // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n // enough that all such attempts are guarded in a try block.\n \"use strict\";\n\n var arr = [];\n var getProto = Object.getPrototypeOf;\n var slice = arr.slice;\n var flat = arr.flat ? function (array) {\n return arr.flat.call(array);\n } : function (array) {\n return arr.concat.apply([], array);\n };\n var push = arr.push;\n var indexOf = arr.indexOf;\n var class2type = {};\n var toString = class2type.toString;\n var hasOwn = class2type.hasOwnProperty;\n var fnToString = hasOwn.toString;\n var ObjectFunctionString = fnToString.call(Object);\n var support = {};\n var isFunction = function isFunction(obj) {\n // Support: Chrome <=57, Firefox <=52\n // In some browsers, typeof returns \"function\" for HTML elements\n // (i.e., `typeof document.createElement( \"object\" ) === \"function\"`).\n // We don't want to classify *any* DOM node as a function.\n // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n // Plus for old WebKit, typeof returns \"function\" for HTML collections\n // (e.g., `typeof document.getElementsByTagName(\"div\") === \"function\"`). (gh-4756)\n return typeof obj === \"function\" && typeof obj.nodeType !== \"number\" && typeof obj.item !== \"function\";\n };\n var isWindow = function isWindow(obj) {\n return obj != null && obj === obj.window;\n };\n var document = window.document;\n var preservedScriptAttributes = {\n type: true,\n src: true,\n nonce: true,\n noModule: true\n };\n function DOMEval(code, node, doc) {\n doc = doc || document;\n var i,\n val,\n script = doc.createElement(\"script\");\n script.text = code;\n if (node) {\n for (i in preservedScriptAttributes) {\n // Support: Firefox 64+, Edge 18+\n // Some browsers don't support the \"nonce\" property on scripts.\n // On the other hand, just using `getAttribute` is not enough as\n // the `nonce` attribute is reset to an empty string whenever it\n // becomes browsing-context connected.\n // See https://github.com/whatwg/html/issues/2369\n // See https://html.spec.whatwg.org/#nonce-attributes\n // The `node.getAttribute` check was added for the sake of\n // `jQuery.globalEval` so that it can fake a nonce-containing node\n // via an object.\n val = node[i] || node.getAttribute && node.getAttribute(i);\n if (val) {\n script.setAttribute(i, val);\n }\n }\n }\n doc.head.appendChild(script).parentNode.removeChild(script);\n }\n function toType(obj) {\n if (obj == null) {\n return obj + \"\";\n }\n\n // Support: Android <=2.3 only (functionish RegExp)\n return typeof obj === \"object\" || typeof obj === \"function\" ? class2type[toString.call(obj)] || \"object\" : typeof obj;\n }\n /* global Symbol */\n // Defining this global in .eslintrc.json would create a danger of using the global\n // unguarded in another place, it seems safer to define global only for this module\n\n var version = \"3.7.1\",\n rhtmlSuffix = /HTML$/i,\n // Define a local copy of jQuery\n jQuery = function (selector, context) {\n // The jQuery object is actually just the init constructor 'enhanced'\n // Need init if jQuery is called (just allow error to be thrown if not included)\n return new jQuery.fn.init(selector, context);\n };\n jQuery.fn = jQuery.prototype = {\n // The current version of jQuery being used\n jquery: version,\n constructor: jQuery,\n // The default length of a jQuery object is 0\n length: 0,\n toArray: function () {\n return slice.call(this);\n },\n // Get the Nth element in the matched element set OR\n // Get the whole matched element set as a clean array\n get: function (num) {\n // Return all the elements in a clean array\n if (num == null) {\n return slice.call(this);\n }\n\n // Return just the one element from the set\n return num < 0 ? this[num + this.length] : this[num];\n },\n // Take an array of elements and push it onto the stack\n // (returning the new matched element set)\n pushStack: function (elems) {\n // Build a new jQuery matched element set\n var ret = jQuery.merge(this.constructor(), elems);\n\n // Add the old object onto the stack (as a reference)\n ret.prevObject = this;\n\n // Return the newly-formed element set\n return ret;\n },\n // Execute a callback for every element in the matched set.\n each: function (callback) {\n return jQuery.each(this, callback);\n },\n map: function (callback) {\n return this.pushStack(jQuery.map(this, function (elem, i) {\n return callback.call(elem, i, elem);\n }));\n },\n slice: function () {\n return this.pushStack(slice.apply(this, arguments));\n },\n first: function () {\n return this.eq(0);\n },\n last: function () {\n return this.eq(-1);\n },\n even: function () {\n return this.pushStack(jQuery.grep(this, function (_elem, i) {\n return (i + 1) % 2;\n }));\n },\n odd: function () {\n return this.pushStack(jQuery.grep(this, function (_elem, i) {\n return i % 2;\n }));\n },\n eq: function (i) {\n var len = this.length,\n j = +i + (i < 0 ? len : 0);\n return this.pushStack(j >= 0 && j < len ? [this[j]] : []);\n },\n end: function () {\n return this.prevObject || this.constructor();\n },\n // For internal use only.\n // Behaves like an Array's method, not like a jQuery method.\n push: push,\n sort: arr.sort,\n splice: arr.splice\n };\n jQuery.extend = jQuery.fn.extend = function () {\n var options,\n name,\n src,\n copy,\n copyIsArray,\n clone,\n target = arguments[0] || {},\n i = 1,\n length = arguments.length,\n deep = false;\n\n // Handle a deep copy situation\n if (typeof target === \"boolean\") {\n deep = target;\n\n // Skip the boolean and the target\n target = arguments[i] || {};\n i++;\n }\n\n // Handle case when target is a string or something (possible in deep copy)\n if (typeof target !== \"object\" && !isFunction(target)) {\n target = {};\n }\n\n // Extend jQuery itself if only one argument is passed\n if (i === length) {\n target = this;\n i--;\n }\n for (; i < length; i++) {\n // Only deal with non-null/undefined values\n if ((options = arguments[i]) != null) {\n // Extend the base object\n for (name in options) {\n copy = options[name];\n\n // Prevent Object.prototype pollution\n // Prevent never-ending loop\n if (name === \"__proto__\" || target === copy) {\n continue;\n }\n\n // Recurse if we're merging plain objects or arrays\n if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {\n src = target[name];\n\n // Ensure proper type for the source value\n if (copyIsArray && !Array.isArray(src)) {\n clone = [];\n } else if (!copyIsArray && !jQuery.isPlainObject(src)) {\n clone = {};\n } else {\n clone = src;\n }\n copyIsArray = false;\n\n // Never move original objects, clone them\n target[name] = jQuery.extend(deep, clone, copy);\n\n // Don't bring in undefined values\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n\n // Return the modified object\n return target;\n };\n jQuery.extend({\n // Unique for each copy of jQuery on the page\n expando: \"jQuery\" + (version + Math.random()).replace(/\\D/g, \"\"),\n // Assume jQuery is ready without the ready module\n isReady: true,\n error: function (msg) {\n throw new Error(msg);\n },\n noop: function () {},\n isPlainObject: function (obj) {\n var proto, Ctor;\n\n // Detect obvious negatives\n // Use toString instead of jQuery.type to catch host objects\n if (!obj || toString.call(obj) !== \"[object Object]\") {\n return false;\n }\n proto = getProto(obj);\n\n // Objects with no prototype (e.g., `Object.create( null )`) are plain\n if (!proto) {\n return true;\n }\n\n // Objects with prototype are plain iff they were constructed by a global Object function\n Ctor = hasOwn.call(proto, \"constructor\") && proto.constructor;\n return typeof Ctor === \"function\" && fnToString.call(Ctor) === ObjectFunctionString;\n },\n isEmptyObject: function (obj) {\n var name;\n for (name in obj) {\n return false;\n }\n return true;\n },\n // Evaluates a script in a provided context; falls back to the global one\n // if not specified.\n globalEval: function (code, options, doc) {\n DOMEval(code, {\n nonce: options && options.nonce\n }, doc);\n },\n each: function (obj, callback) {\n var length,\n i = 0;\n if (isArrayLike(obj)) {\n length = obj.length;\n for (; i < length; i++) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n if (callback.call(obj[i], i, obj[i]) === false) {\n break;\n }\n }\n }\n return obj;\n },\n // Retrieve the text value of an array of DOM nodes\n text: function (elem) {\n var node,\n ret = \"\",\n i = 0,\n nodeType = elem.nodeType;\n if (!nodeType) {\n // If no nodeType, this is expected to be an array\n while (node = elem[i++]) {\n // Do not traverse comment nodes\n ret += jQuery.text(node);\n }\n }\n if (nodeType === 1 || nodeType === 11) {\n return elem.textContent;\n }\n if (nodeType === 9) {\n return elem.documentElement.textContent;\n }\n if (nodeType === 3 || nodeType === 4) {\n return elem.nodeValue;\n }\n\n // Do not include comment or processing instruction nodes\n\n return ret;\n },\n // results is for internal usage only\n makeArray: function (arr, results) {\n var ret = results || [];\n if (arr != null) {\n if (isArrayLike(Object(arr))) {\n jQuery.merge(ret, typeof arr === \"string\" ? [arr] : arr);\n } else {\n push.call(ret, arr);\n }\n }\n return ret;\n },\n inArray: function (elem, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, elem, i);\n },\n isXMLDoc: function (elem) {\n var namespace = elem && elem.namespaceURI,\n docElem = elem && (elem.ownerDocument || elem).documentElement;\n\n // Assume HTML when documentElement doesn't yet exist, such as inside\n // document fragments.\n return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || \"HTML\");\n },\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n merge: function (first, second) {\n var len = +second.length,\n j = 0,\n i = first.length;\n for (; j < len; j++) {\n first[i++] = second[j];\n }\n first.length = i;\n return first;\n },\n grep: function (elems, callback, invert) {\n var callbackInverse,\n matches = [],\n i = 0,\n length = elems.length,\n callbackExpect = !invert;\n\n // Go through the array, only saving the items\n // that pass the validator function\n for (; i < length; i++) {\n callbackInverse = !callback(elems[i], i);\n if (callbackInverse !== callbackExpect) {\n matches.push(elems[i]);\n }\n }\n return matches;\n },\n // arg is for internal usage only\n map: function (elems, callback, arg) {\n var length,\n value,\n i = 0,\n ret = [];\n\n // Go through the array, translating each of the items to their new values\n if (isArrayLike(elems)) {\n length = elems.length;\n for (; i < length; i++) {\n value = callback(elems[i], i, arg);\n if (value != null) {\n ret.push(value);\n }\n }\n\n // Go through every key on the object,\n } else {\n for (i in elems) {\n value = callback(elems[i], i, arg);\n if (value != null) {\n ret.push(value);\n }\n }\n }\n\n // Flatten any nested arrays\n return flat(ret);\n },\n // A global GUID counter for objects\n guid: 1,\n // jQuery.support is not used in Core but other projects attach their\n // properties to it so it needs to exist.\n support: support\n });\n if (typeof Symbol === \"function\") {\n jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];\n }\n\n // Populate the class2type map\n jQuery.each(\"Boolean Number String Function Array Date RegExp Object Error Symbol\".split(\" \"), function (_i, name) {\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\n });\n function isArrayLike(obj) {\n // Support: real iOS 8.2 only (not reproducible in simulator)\n // `in` check used to prevent JIT error (gh-2145)\n // hasOwn isn't used here due to false negatives\n // regarding Nodelist length in IE\n var length = !!obj && \"length\" in obj && obj.length,\n type = toType(obj);\n if (isFunction(obj) || isWindow(obj)) {\n return false;\n }\n return type === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n function nodeName(elem, name) {\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n }\n var pop = arr.pop;\n var sort = arr.sort;\n var splice = arr.splice;\n var whitespace = \"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\";\n var rtrimCSS = new RegExp(\"^\" + whitespace + \"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\" + whitespace + \"+$\", \"g\");\n\n // Note: an element does not contain itself\n jQuery.contains = function (a, b) {\n var bup = b && b.parentNode;\n return a === bup || !!(bup && bup.nodeType === 1 && (\n // Support: IE 9 - 11+\n // IE doesn't have `contains` on SVG.\n a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));\n };\n\n // CSS string/identifier serialization\n // https://drafts.csswg.org/cssom/#common-serializing-idioms\n var rcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\x80-\\uFFFF\\w-]/g;\n function fcssescape(ch, asCodePoint) {\n if (asCodePoint) {\n // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n if (ch === \"\\0\") {\n return \"\\uFFFD\";\n }\n\n // Control characters and (dependent upon position) numbers get escaped as code points\n return ch.slice(0, -1) + \"\\\\\" + ch.charCodeAt(ch.length - 1).toString(16) + \" \";\n }\n\n // Other potentially-special ASCII characters get backslash-escaped\n return \"\\\\\" + ch;\n }\n jQuery.escapeSelector = function (sel) {\n return (sel + \"\").replace(rcssescape, fcssescape);\n };\n var preferredDoc = document,\n pushNative = push;\n (function () {\n var i,\n Expr,\n outermostContext,\n sortInput,\n hasDuplicate,\n push = pushNative,\n // Local document vars\n document,\n documentElement,\n documentIsHTML,\n rbuggyQSA,\n matches,\n // Instance-specific data\n expando = jQuery.expando,\n dirruns = 0,\n done = 0,\n classCache = createCache(),\n tokenCache = createCache(),\n compilerCache = createCache(),\n nonnativeSelectorCache = createCache(),\n sortOrder = function (a, b) {\n if (a === b) {\n hasDuplicate = true;\n }\n return 0;\n },\n booleans = \"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|\" + \"loop|multiple|open|readonly|required|scoped\",\n // Regular expressions\n\n // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n identifier = \"(?:\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+\",\n // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors\n attributes = \"\\\\[\" + whitespace + \"*(\" + identifier + \")(?:\" + whitespace +\n // Operator (capture 2)\n \"*([*^$|!~]?=)\" + whitespace +\n // \"Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]\"\n \"*(?:'((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\"|(\" + identifier + \"))|)\" + whitespace + \"*\\\\]\",\n pseudos = \":(\" + identifier + \")(?:\\\\((\" +\n // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n // 1. quoted (capture 3; capture 4 or capture 5)\n \"('((?:\\\\\\\\.|[^\\\\\\\\'])*)'|\\\"((?:\\\\\\\\.|[^\\\\\\\\\\\"])*)\\\")|\" +\n // 2. simple (capture 6)\n \"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\" + attributes + \")*)|\" +\n // 3. anything else (capture 2)\n \".*\" + \")\\\\)|)\",\n // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n rwhitespace = new RegExp(whitespace + \"+\", \"g\"),\n rcomma = new RegExp(\"^\" + whitespace + \"*,\" + whitespace + \"*\"),\n rleadingCombinator = new RegExp(\"^\" + whitespace + \"*([>+~]|\" + whitespace + \")\" + whitespace + \"*\"),\n rdescend = new RegExp(whitespace + \"|>\"),\n rpseudo = new RegExp(pseudos),\n ridentifier = new RegExp(\"^\" + identifier + \"$\"),\n matchExpr = {\n ID: new RegExp(\"^#(\" + identifier + \")\"),\n CLASS: new RegExp(\"^\\\\.(\" + identifier + \")\"),\n TAG: new RegExp(\"^(\" + identifier + \"|[*])\"),\n ATTR: new RegExp(\"^\" + attributes),\n PSEUDO: new RegExp(\"^\" + pseudos),\n CHILD: new RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\" + whitespace + \"*(even|odd|(([+-]|)(\\\\d*)n|)\" + whitespace + \"*(?:([+-]|)\" + whitespace + \"*(\\\\d+)|))\" + whitespace + \"*\\\\)|)\", \"i\"),\n bool: new RegExp(\"^(?:\" + booleans + \")$\", \"i\"),\n // For use in libraries implementing .is()\n // We use this for POS matching in `select`\n needsContext: new RegExp(\"^\" + whitespace + \"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\" + whitespace + \"*((?:-\\\\d)?\\\\d*)\" + whitespace + \"*\\\\)|)(?=[^-]|$)\", \"i\")\n },\n rinputs = /^(?:input|select|textarea|button)$/i,\n rheader = /^h\\d$/i,\n // Easily-parseable/retrievable ID or TAG or CLASS selectors\n rquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n rsibling = /[+~]/,\n // CSS escapes\n // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n runescape = new RegExp(\"\\\\\\\\[\\\\da-fA-F]{1,6}\" + whitespace + \"?|\\\\\\\\([^\\\\r\\\\n\\\\f])\", \"g\"),\n funescape = function (escape, nonHex) {\n var high = \"0x\" + escape.slice(1) - 0x10000;\n if (nonHex) {\n // Strip the backslash prefix from a non-hex escape sequence\n return nonHex;\n }\n\n // Replace a hexadecimal escape sequence with the encoded Unicode code point\n // Support: IE <=11+\n // For values outside the Basic Multilingual Plane (BMP), manually construct a\n // surrogate pair\n return high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00);\n },\n // Used for iframes; see `setDocument`.\n // Support: IE 9 - 11+, Edge 12 - 18+\n // Removing the function wrapper causes a \"Permission Denied\"\n // error in IE/Edge.\n unloadHandler = function () {\n setDocument();\n },\n inDisabledFieldset = addCombinator(function (elem) {\n return elem.disabled === true && nodeName(elem, \"fieldset\");\n }, {\n dir: \"parentNode\",\n next: \"legend\"\n });\n\n // Support: IE <=9 only\n // Accessing document.activeElement can throw unexpectedly\n // https://bugs.jquery.com/ticket/13393\n function safeActiveElement() {\n try {\n return document.activeElement;\n } catch (err) {}\n }\n\n // Optimize for push.apply( _, NodeList )\n try {\n push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);\n\n // Support: Android <=4.0\n // Detect silently failing push.apply\n // eslint-disable-next-line no-unused-expressions\n arr[preferredDoc.childNodes.length].nodeType;\n } catch (e) {\n push = {\n apply: function (target, els) {\n pushNative.apply(target, slice.call(els));\n },\n call: function (target) {\n pushNative.apply(target, slice.call(arguments, 1));\n }\n };\n }\n function find(selector, context, results, seed) {\n var m,\n i,\n elem,\n nid,\n match,\n groups,\n newSelector,\n newContext = context && context.ownerDocument,\n // nodeType defaults to 9, since context defaults to document\n nodeType = context ? context.nodeType : 9;\n results = results || [];\n\n // Return early from calls with invalid selector or context\n if (typeof selector !== \"string\" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {\n return results;\n }\n\n // Try to shortcut find operations (as opposed to filters) in HTML documents\n if (!seed) {\n setDocument(context);\n context = context || document;\n if (documentIsHTML) {\n // If the selector is sufficiently simple, try using a \"get*By*\" DOM method\n // (excepting DocumentFragment context, where the methods don't exist)\n if (nodeType !== 11 && (match = rquickExpr.exec(selector))) {\n // ID selector\n if (m = match[1]) {\n // Document context\n if (nodeType === 9) {\n if (elem = context.getElementById(m)) {\n // Support: IE 9 only\n // getElementById can match elements by name instead of ID\n if (elem.id === m) {\n push.call(results, elem);\n return results;\n }\n } else {\n return results;\n }\n\n // Element context\n } else {\n // Support: IE 9 only\n // getElementById can match elements by name instead of ID\n if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) {\n push.call(results, elem);\n return results;\n }\n }\n\n // Type selector\n } else if (match[2]) {\n push.apply(results, context.getElementsByTagName(selector));\n return results;\n\n // Class selector\n } else if ((m = match[3]) && context.getElementsByClassName) {\n push.apply(results, context.getElementsByClassName(m));\n return results;\n }\n }\n\n // Take advantage of querySelectorAll\n if (!nonnativeSelectorCache[selector + \" \"] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {\n newSelector = selector;\n newContext = context;\n\n // qSA considers elements outside a scoping root when evaluating child or\n // descendant combinators, which is not what we want.\n // In such cases, we work around the behavior by prefixing every selector in the\n // list with an ID selector referencing the scope context.\n // The technique has to be used as well when a leading combinator is used\n // as such selectors are not recognized by querySelectorAll.\n // Thanks to Andrew Dupont for this technique.\n if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {\n // Expand context for sibling selectors\n newContext = rsibling.test(selector) && testContext(context.parentNode) || context;\n\n // We can use :scope instead of the ID hack if the browser\n // supports it & if we're not changing the context.\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when\n // strict-comparing two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (newContext != context || !support.scope) {\n // Capture the context ID, setting it first if necessary\n if (nid = context.getAttribute(\"id\")) {\n nid = jQuery.escapeSelector(nid);\n } else {\n context.setAttribute(\"id\", nid = expando);\n }\n }\n\n // Prefix every selector in the list\n groups = tokenize(selector);\n i = groups.length;\n while (i--) {\n groups[i] = (nid ? \"#\" + nid : \":scope\") + \" \" + toSelector(groups[i]);\n }\n newSelector = groups.join(\",\");\n }\n try {\n push.apply(results, newContext.querySelectorAll(newSelector));\n return results;\n } catch (qsaError) {\n nonnativeSelectorCache(selector, true);\n } finally {\n if (nid === expando) {\n context.removeAttribute(\"id\");\n }\n }\n }\n }\n }\n\n // All others\n return select(selector.replace(rtrimCSS, \"$1\"), context, results, seed);\n }\n\n /**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\n function createCache() {\n var keys = [];\n function cache(key, value) {\n // Use (key + \" \") to avoid collision with native prototype properties\n // (see https://github.com/jquery/sizzle/issues/157)\n if (keys.push(key + \" \") > Expr.cacheLength) {\n // Only keep the most recent entries\n delete cache[keys.shift()];\n }\n return cache[key + \" \"] = value;\n }\n return cache;\n }\n\n /**\n * Mark a function for special use by jQuery selector module\n * @param {Function} fn The function to mark\n */\n function markFunction(fn) {\n fn[expando] = true;\n return fn;\n }\n\n /**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\n function assert(fn) {\n var el = document.createElement(\"fieldset\");\n try {\n return !!fn(el);\n } catch (e) {\n return false;\n } finally {\n // Remove from its parent by default\n if (el.parentNode) {\n el.parentNode.removeChild(el);\n }\n\n // release memory in IE\n el = null;\n }\n }\n\n /**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\n function createInputPseudo(type) {\n return function (elem) {\n return nodeName(elem, \"input\") && elem.type === type;\n };\n }\n\n /**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\n function createButtonPseudo(type) {\n return function (elem) {\n return (nodeName(elem, \"input\") || nodeName(elem, \"button\")) && elem.type === type;\n };\n }\n\n /**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\n function createDisabledPseudo(disabled) {\n // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n return function (elem) {\n // Only certain elements can match :enabled or :disabled\n // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n if (\"form\" in elem) {\n // Check for inherited disabledness on relevant non-disabled elements:\n // * listed form-associated elements in a disabled fieldset\n // https://html.spec.whatwg.org/multipage/forms.html#category-listed\n // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n // * option elements in a disabled optgroup\n // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n // All such elements have a \"form\" property.\n if (elem.parentNode && elem.disabled === false) {\n // Option elements defer to a parent optgroup if present\n if (\"label\" in elem) {\n if (\"label\" in elem.parentNode) {\n return elem.parentNode.disabled === disabled;\n } else {\n return elem.disabled === disabled;\n }\n }\n\n // Support: IE 6 - 11+\n // Use the isDisabled shortcut property to check for disabled fieldset ancestors\n return elem.isDisabled === disabled ||\n // Where there is no isDisabled, check manually\n elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;\n }\n return elem.disabled === disabled;\n\n // Try to winnow out elements that can't be disabled before trusting the disabled property.\n // Some victims get caught in our net (label, legend, menu, track), but it shouldn't\n // even exist on them, let alone have a boolean value.\n } else if (\"label\" in elem) {\n return elem.disabled === disabled;\n }\n\n // Remaining elements are neither :enabled nor :disabled\n return false;\n };\n }\n\n /**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\n function createPositionalPseudo(fn) {\n return markFunction(function (argument) {\n argument = +argument;\n return markFunction(function (seed, matches) {\n var j,\n matchIndexes = fn([], seed.length, argument),\n i = matchIndexes.length;\n\n // Match elements found at the specified indexes\n while (i--) {\n if (seed[j = matchIndexes[i]]) {\n seed[j] = !(matches[j] = seed[j]);\n }\n }\n });\n });\n }\n\n /**\n * Checks a node for validity as a jQuery selector context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\n function testContext(context) {\n return context && typeof context.getElementsByTagName !== \"undefined\" && context;\n }\n\n /**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [node] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\n function setDocument(node) {\n var subWindow,\n doc = node ? node.ownerDocument || node : preferredDoc;\n\n // Return early if doc is invalid or already selected\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (doc == document || doc.nodeType !== 9 || !doc.documentElement) {\n return document;\n }\n\n // Update global variables\n document = doc;\n documentElement = document.documentElement;\n documentIsHTML = !jQuery.isXMLDoc(document);\n\n // Support: iOS 7 only, IE 9 - 11+\n // Older browsers didn't support unprefixed `matches`.\n matches = documentElement.matches || documentElement.webkitMatchesSelector || documentElement.msMatchesSelector;\n\n // Support: IE 9 - 11+, Edge 12 - 18+\n // Accessing iframe documents after unload throws \"permission denied\" errors\n // (see trac-13936).\n // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,\n // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.\n if (documentElement.msMatchesSelector &&\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n preferredDoc != document && (subWindow = document.defaultView) && subWindow.top !== subWindow) {\n // Support: IE 9 - 11+, Edge 12 - 18+\n subWindow.addEventListener(\"unload\", unloadHandler);\n }\n\n // Support: IE <10\n // Check if getElementById returns elements by name\n // The broken getElementById methods don't pick up programmatically-set names,\n // so use a roundabout getElementsByName test\n support.getById = assert(function (el) {\n documentElement.appendChild(el).id = jQuery.expando;\n return !document.getElementsByName || !document.getElementsByName(jQuery.expando).length;\n });\n\n // Support: IE 9 only\n // Check to see if it's possible to do matchesSelector\n // on a disconnected node.\n support.disconnectedMatch = assert(function (el) {\n return matches.call(el, \"*\");\n });\n\n // Support: IE 9 - 11+, Edge 12 - 18+\n // IE/Edge don't support the :scope pseudo-class.\n support.scope = assert(function () {\n return document.querySelectorAll(\":scope\");\n });\n\n // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only\n // Make sure the `:has()` argument is parsed unforgivingly.\n // We include `*` in the test to detect buggy implementations that are\n // _selectively_ forgiving (specifically when the list includes at least\n // one valid selector).\n // Note that we treat complete lack of support for `:has()` as if it were\n // spec-compliant support, which is fine because use of `:has()` in such\n // environments will fail in the qSA path and fall back to jQuery traversal\n // anyway.\n support.cssHas = assert(function () {\n try {\n document.querySelector(\":has(*,:jqfake)\");\n return false;\n } catch (e) {\n return true;\n }\n });\n\n // ID filter and find\n if (support.getById) {\n Expr.filter.ID = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n return elem.getAttribute(\"id\") === attrId;\n };\n };\n Expr.find.ID = function (id, context) {\n if (typeof context.getElementById !== \"undefined\" && documentIsHTML) {\n var elem = context.getElementById(id);\n return elem ? [elem] : [];\n }\n };\n } else {\n Expr.filter.ID = function (id) {\n var attrId = id.replace(runescape, funescape);\n return function (elem) {\n var node = typeof elem.getAttributeNode !== \"undefined\" && elem.getAttributeNode(\"id\");\n return node && node.value === attrId;\n };\n };\n\n // Support: IE 6 - 7 only\n // getElementById is not reliable as a find shortcut\n Expr.find.ID = function (id, context) {\n if (typeof context.getElementById !== \"undefined\" && documentIsHTML) {\n var node,\n i,\n elems,\n elem = context.getElementById(id);\n if (elem) {\n // Verify the id attribute\n node = elem.getAttributeNode(\"id\");\n if (node && node.value === id) {\n return [elem];\n }\n\n // Fall back on getElementsByName\n elems = context.getElementsByName(id);\n i = 0;\n while (elem = elems[i++]) {\n node = elem.getAttributeNode(\"id\");\n if (node && node.value === id) {\n return [elem];\n }\n }\n }\n return [];\n }\n };\n }\n\n // Tag\n Expr.find.TAG = function (tag, context) {\n if (typeof context.getElementsByTagName !== \"undefined\") {\n return context.getElementsByTagName(tag);\n\n // DocumentFragment nodes don't have gEBTN\n } else {\n return context.querySelectorAll(tag);\n }\n };\n\n // Class\n Expr.find.CLASS = function (className, context) {\n if (typeof context.getElementsByClassName !== \"undefined\" && documentIsHTML) {\n return context.getElementsByClassName(className);\n }\n };\n\n /* QSA/matchesSelector\n ---------------------------------------------------------------------- */\n\n // QSA and matchesSelector support\n\n rbuggyQSA = [];\n\n // Build QSA regex\n // Regex strategy adopted from Diego Perini\n assert(function (el) {\n var input;\n documentElement.appendChild(el).innerHTML = \"\" + \"\";\n\n // Support: iOS <=7 - 8 only\n // Boolean attributes and \"value\" are not treated correctly in some XML documents\n if (!el.querySelectorAll(\"[selected]\").length) {\n rbuggyQSA.push(\"\\\\[\" + whitespace + \"*(?:value|\" + booleans + \")\");\n }\n\n // Support: iOS <=7 - 8 only\n if (!el.querySelectorAll(\"[id~=\" + expando + \"-]\").length) {\n rbuggyQSA.push(\"~=\");\n }\n\n // Support: iOS 8 only\n // https://bugs.webkit.org/show_bug.cgi?id=136851\n // In-page `selector#id sibling-combinator selector` fails\n if (!el.querySelectorAll(\"a#\" + expando + \"+*\").length) {\n rbuggyQSA.push(\".#.+[+~]\");\n }\n\n // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n // In some of the document kinds, these selectors wouldn't work natively.\n // This is probably OK but for backwards compatibility we want to maintain\n // handling them through jQuery traversal in jQuery 3.x.\n if (!el.querySelectorAll(\":checked\").length) {\n rbuggyQSA.push(\":checked\");\n }\n\n // Support: Windows 8 Native Apps\n // The type and name attributes are restricted during .innerHTML assignment\n input = document.createElement(\"input\");\n input.setAttribute(\"type\", \"hidden\");\n el.appendChild(input).setAttribute(\"name\", \"D\");\n\n // Support: IE 9 - 11+\n // IE's :disabled selector does not pick up the children of disabled fieldsets\n // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+\n // In some of the document kinds, these selectors wouldn't work natively.\n // This is probably OK but for backwards compatibility we want to maintain\n // handling them through jQuery traversal in jQuery 3.x.\n documentElement.appendChild(el).disabled = true;\n if (el.querySelectorAll(\":disabled\").length !== 2) {\n rbuggyQSA.push(\":enabled\", \":disabled\");\n }\n\n // Support: IE 11+, Edge 15 - 18+\n // IE 11/Edge don't find elements on a `[name='']` query in some cases.\n // Adding a temporary attribute to the document before the selection works\n // around the issue.\n // Interestingly, IE 10 & older don't seem to have the issue.\n input = document.createElement(\"input\");\n input.setAttribute(\"name\", \"\");\n el.appendChild(input);\n if (!el.querySelectorAll(\"[name='']\").length) {\n rbuggyQSA.push(\"\\\\[\" + whitespace + \"*name\" + whitespace + \"*=\" + whitespace + \"*(?:''|\\\"\\\")\");\n }\n });\n if (!support.cssHas) {\n // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+\n // Our regular `try-catch` mechanism fails to detect natively-unsupported\n // pseudo-classes inside `:has()` (such as `:has(:contains(\"Foo\"))`)\n // in browsers that parse the `:has()` argument as a forgiving selector list.\n // https://drafts.csswg.org/selectors/#relational now requires the argument\n // to be parsed unforgivingly, but browsers have not yet fully adjusted.\n rbuggyQSA.push(\":has\");\n }\n rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join(\"|\"));\n\n /* Sorting\n ---------------------------------------------------------------------- */\n\n // Document order sorting\n sortOrder = function (a, b) {\n // Flag for duplicate removal\n if (a === b) {\n hasDuplicate = true;\n return 0;\n }\n\n // Sort on method existence if only one input has compareDocumentPosition\n var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n if (compare) {\n return compare;\n }\n\n // Calculate position if both inputs belong to the same document\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) :\n // Otherwise we know they are disconnected\n 1;\n\n // Disconnected nodes\n if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {\n // Choose the first element that is related to our preferred document\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (a === document || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) {\n return -1;\n }\n\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (b === document || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) {\n return 1;\n }\n\n // Maintain original order\n return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;\n }\n return compare & 4 ? -1 : 1;\n };\n return document;\n }\n find.matches = function (expr, elements) {\n return find(expr, null, null, elements);\n };\n find.matchesSelector = function (elem, expr) {\n setDocument(elem);\n if (documentIsHTML && !nonnativeSelectorCache[expr + \" \"] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {\n try {\n var ret = matches.call(elem, expr);\n\n // IE 9's matchesSelector returns false on disconnected nodes\n if (ret || support.disconnectedMatch ||\n // As well, disconnected nodes are said to be in a document\n // fragment in IE 9\n elem.document && elem.document.nodeType !== 11) {\n return ret;\n }\n } catch (e) {\n nonnativeSelectorCache(expr, true);\n }\n }\n return find(expr, document, null, [elem]).length > 0;\n };\n find.contains = function (context, elem) {\n // Set document vars if needed\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if ((context.ownerDocument || context) != document) {\n setDocument(context);\n }\n return jQuery.contains(context, elem);\n };\n find.attr = function (elem, name) {\n // Set document vars if needed\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if ((elem.ownerDocument || elem) != document) {\n setDocument(elem);\n }\n var fn = Expr.attrHandle[name.toLowerCase()],\n // Don't get fooled by Object.prototype properties (see trac-13807)\n val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined;\n if (val !== undefined) {\n return val;\n }\n return elem.getAttribute(name);\n };\n find.error = function (msg) {\n throw new Error(\"Syntax error, unrecognized expression: \" + msg);\n };\n\n /**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\n jQuery.uniqueSort = function (results) {\n var elem,\n duplicates = [],\n j = 0,\n i = 0;\n\n // Unless we *know* we can detect duplicates, assume their presence\n //\n // Support: Android <=4.0+\n // Testing for detecting duplicates is unpredictable so instead assume we can't\n // depend on duplicate detection in all browsers without a stable sort.\n hasDuplicate = !support.sortStable;\n sortInput = !support.sortStable && slice.call(results, 0);\n sort.call(results, sortOrder);\n if (hasDuplicate) {\n while (elem = results[i++]) {\n if (elem === results[i]) {\n j = duplicates.push(i);\n }\n }\n while (j--) {\n splice.call(results, duplicates[j], 1);\n }\n }\n\n // Clear input after sorting to release objects\n // See https://github.com/jquery/sizzle/pull/225\n sortInput = null;\n return results;\n };\n jQuery.fn.uniqueSort = function () {\n return this.pushStack(jQuery.uniqueSort(slice.apply(this)));\n };\n Expr = jQuery.expr = {\n // Can be adjusted by the user\n cacheLength: 50,\n createPseudo: markFunction,\n match: matchExpr,\n attrHandle: {},\n find: {},\n relative: {\n \">\": {\n dir: \"parentNode\",\n first: true\n },\n \" \": {\n dir: \"parentNode\"\n },\n \"+\": {\n dir: \"previousSibling\",\n first: true\n },\n \"~\": {\n dir: \"previousSibling\"\n }\n },\n preFilter: {\n ATTR: function (match) {\n match[1] = match[1].replace(runescape, funescape);\n\n // Move the given value to match[3] whether quoted or unquoted\n match[3] = (match[3] || match[4] || match[5] || \"\").replace(runescape, funescape);\n if (match[2] === \"~=\") {\n match[3] = \" \" + match[3] + \" \";\n }\n return match.slice(0, 4);\n },\n CHILD: function (match) {\n /* matches from matchExpr[\"CHILD\"]\n \t1 type (only|nth|...)\n \t2 what (child|of-type)\n \t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n \t4 xn-component of xn+y argument ([+-]?\\d*n|)\n \t5 sign of xn-component\n \t6 x of xn-component\n \t7 sign of y-component\n \t8 y of y-component\n */\n match[1] = match[1].toLowerCase();\n if (match[1].slice(0, 3) === \"nth\") {\n // nth-* requires argument\n if (!match[3]) {\n find.error(match[0]);\n }\n\n // numeric x and y parameters for Expr.filter.CHILD\n // remember that false/true cast respectively to 0/1\n match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === \"even\" || match[3] === \"odd\"));\n match[5] = +(match[7] + match[8] || match[3] === \"odd\");\n\n // other types prohibit arguments\n } else if (match[3]) {\n find.error(match[0]);\n }\n return match;\n },\n PSEUDO: function (match) {\n var excess,\n unquoted = !match[6] && match[2];\n if (matchExpr.CHILD.test(match[0])) {\n return null;\n }\n\n // Accept quoted arguments as-is\n if (match[3]) {\n match[2] = match[4] || match[5] || \"\";\n\n // Strip excess characters from unquoted arguments\n } else if (unquoted && rpseudo.test(unquoted) && (\n // Get excess from tokenize (recursively)\n excess = tokenize(unquoted, true)) && (\n // advance to the next closing parenthesis\n excess = unquoted.indexOf(\")\", unquoted.length - excess) - unquoted.length)) {\n // excess is a negative index\n match[0] = match[0].slice(0, excess);\n match[2] = unquoted.slice(0, excess);\n }\n\n // Return only captures needed by the pseudo filter method (type and argument)\n return match.slice(0, 3);\n }\n },\n filter: {\n TAG: function (nodeNameSelector) {\n var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();\n return nodeNameSelector === \"*\" ? function () {\n return true;\n } : function (elem) {\n return nodeName(elem, expectedNodeName);\n };\n },\n CLASS: function (className) {\n var pattern = classCache[className + \" \"];\n return pattern || (pattern = new RegExp(\"(^|\" + whitespace + \")\" + className + \"(\" + whitespace + \"|$)\")) && classCache(className, function (elem) {\n return pattern.test(typeof elem.className === \"string\" && elem.className || typeof elem.getAttribute !== \"undefined\" && elem.getAttribute(\"class\") || \"\");\n });\n },\n ATTR: function (name, operator, check) {\n return function (elem) {\n var result = find.attr(elem, name);\n if (result == null) {\n return operator === \"!=\";\n }\n if (!operator) {\n return true;\n }\n result += \"\";\n if (operator === \"=\") {\n return result === check;\n }\n if (operator === \"!=\") {\n return result !== check;\n }\n if (operator === \"^=\") {\n return check && result.indexOf(check) === 0;\n }\n if (operator === \"*=\") {\n return check && result.indexOf(check) > -1;\n }\n if (operator === \"$=\") {\n return check && result.slice(-check.length) === check;\n }\n if (operator === \"~=\") {\n return (\" \" + result.replace(rwhitespace, \" \") + \" \").indexOf(check) > -1;\n }\n if (operator === \"|=\") {\n return result === check || result.slice(0, check.length + 1) === check + \"-\";\n }\n return false;\n };\n },\n CHILD: function (type, what, _argument, first, last) {\n var simple = type.slice(0, 3) !== \"nth\",\n forward = type.slice(-4) !== \"last\",\n ofType = what === \"of-type\";\n return first === 1 && last === 0 ?\n // Shortcut for :nth-*(n)\n function (elem) {\n return !!elem.parentNode;\n } : function (elem, _context, xml) {\n var cache,\n outerCache,\n node,\n nodeIndex,\n start,\n dir = simple !== forward ? \"nextSibling\" : \"previousSibling\",\n parent = elem.parentNode,\n name = ofType && elem.nodeName.toLowerCase(),\n useCache = !xml && !ofType,\n diff = false;\n if (parent) {\n // :(first|last|only)-(child|of-type)\n if (simple) {\n while (dir) {\n node = elem;\n while (node = node[dir]) {\n if (ofType ? nodeName(node, name) : node.nodeType === 1) {\n return false;\n }\n }\n\n // Reverse direction for :only-* (if we haven't yet done so)\n start = dir = type === \"only\" && !start && \"nextSibling\";\n }\n return true;\n }\n start = [forward ? parent.firstChild : parent.lastChild];\n\n // non-xml :nth-child(...) stores cache data on `parent`\n if (forward && useCache) {\n // Seek `elem` from a previously-cached index\n outerCache = parent[expando] || (parent[expando] = {});\n cache = outerCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex && cache[2];\n node = nodeIndex && parent.childNodes[nodeIndex];\n while (node = ++nodeIndex && node && node[dir] || (\n // Fallback to seeking `elem` from the start\n diff = nodeIndex = 0) || start.pop()) {\n // When found, cache indexes on `parent` and break\n if (node.nodeType === 1 && ++diff && node === elem) {\n outerCache[type] = [dirruns, nodeIndex, diff];\n break;\n }\n }\n } else {\n // Use previously-cached element index if available\n if (useCache) {\n outerCache = elem[expando] || (elem[expando] = {});\n cache = outerCache[type] || [];\n nodeIndex = cache[0] === dirruns && cache[1];\n diff = nodeIndex;\n }\n\n // xml :nth-child(...)\n // or :nth-last-child(...) or :nth(-last)?-of-type(...)\n if (diff === false) {\n // Use the same loop as above to seek `elem` from the start\n while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {\n if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {\n // Cache the index of each encountered element\n if (useCache) {\n outerCache = node[expando] || (node[expando] = {});\n outerCache[type] = [dirruns, diff];\n }\n if (node === elem) {\n break;\n }\n }\n }\n }\n }\n\n // Incorporate the offset, then check against cycle size\n diff -= last;\n return diff === first || diff % first === 0 && diff / first >= 0;\n }\n };\n },\n PSEUDO: function (pseudo, argument) {\n // pseudo-class names are case-insensitive\n // https://www.w3.org/TR/selectors/#pseudo-classes\n // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n // Remember that setFilters inherits from pseudos\n var args,\n fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error(\"unsupported pseudo: \" + pseudo);\n\n // The user may use createPseudo to indicate that\n // arguments are needed to create the filter function\n // just as jQuery does\n if (fn[expando]) {\n return fn(argument);\n }\n\n // But maintain support for old signatures\n if (fn.length > 1) {\n args = [pseudo, pseudo, \"\", argument];\n return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {\n var idx,\n matched = fn(seed, argument),\n i = matched.length;\n while (i--) {\n idx = indexOf.call(seed, matched[i]);\n seed[idx] = !(matches[idx] = matched[i]);\n }\n }) : function (elem) {\n return fn(elem, 0, args);\n };\n }\n return fn;\n }\n },\n pseudos: {\n // Potentially complex pseudos\n not: markFunction(function (selector) {\n // Trim the selector passed to compile\n // to avoid treating leading and trailing\n // spaces as combinators\n var input = [],\n results = [],\n matcher = compile(selector.replace(rtrimCSS, \"$1\"));\n return matcher[expando] ? markFunction(function (seed, matches, _context, xml) {\n var elem,\n unmatched = matcher(seed, null, xml, []),\n i = seed.length;\n\n // Match elements unmatched by `matcher`\n while (i--) {\n if (elem = unmatched[i]) {\n seed[i] = !(matches[i] = elem);\n }\n }\n }) : function (elem, _context, xml) {\n input[0] = elem;\n matcher(input, null, xml, results);\n\n // Don't keep the element\n // (see https://github.com/jquery/sizzle/issues/299)\n input[0] = null;\n return !results.pop();\n };\n }),\n has: markFunction(function (selector) {\n return function (elem) {\n return find(selector, elem).length > 0;\n };\n }),\n contains: markFunction(function (text) {\n text = text.replace(runescape, funescape);\n return function (elem) {\n return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;\n };\n }),\n // \"Whether an element is represented by a :lang() selector\n // is based solely on the element's language value\n // being equal to the identifier C,\n // or beginning with the identifier C immediately followed by \"-\".\n // The matching of C against the element's language value is performed case-insensitively.\n // The identifier C does not have to be a valid language name.\"\n // https://www.w3.org/TR/selectors/#lang-pseudo\n lang: markFunction(function (lang) {\n // lang value must be a valid identifier\n if (!ridentifier.test(lang || \"\")) {\n find.error(\"unsupported lang: \" + lang);\n }\n lang = lang.replace(runescape, funescape).toLowerCase();\n return function (elem) {\n var elemLang;\n do {\n if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute(\"xml:lang\") || elem.getAttribute(\"lang\")) {\n elemLang = elemLang.toLowerCase();\n return elemLang === lang || elemLang.indexOf(lang + \"-\") === 0;\n }\n } while ((elem = elem.parentNode) && elem.nodeType === 1);\n return false;\n };\n }),\n // Miscellaneous\n target: function (elem) {\n var hash = window.location && window.location.hash;\n return hash && hash.slice(1) === elem.id;\n },\n root: function (elem) {\n return elem === documentElement;\n },\n focus: function (elem) {\n return elem === safeActiveElement() && document.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);\n },\n // Boolean properties\n enabled: createDisabledPseudo(false),\n disabled: createDisabledPseudo(true),\n checked: function (elem) {\n // In CSS3, :checked should return both checked and selected elements\n // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n return nodeName(elem, \"input\") && !!elem.checked || nodeName(elem, \"option\") && !!elem.selected;\n },\n selected: function (elem) {\n // Support: IE <=11+\n // Accessing the selectedIndex property\n // forces the browser to treat the default option as\n // selected when in an optgroup.\n if (elem.parentNode) {\n // eslint-disable-next-line no-unused-expressions\n elem.parentNode.selectedIndex;\n }\n return elem.selected === true;\n },\n // Contents\n empty: function (elem) {\n // https://www.w3.org/TR/selectors/#empty-pseudo\n // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n // but not by others (comment: 8; processing instruction: 7; etc.)\n // nodeType < 6 works because attributes (2) do not appear as children\n for (elem = elem.firstChild; elem; elem = elem.nextSibling) {\n if (elem.nodeType < 6) {\n return false;\n }\n }\n return true;\n },\n parent: function (elem) {\n return !Expr.pseudos.empty(elem);\n },\n // Element/input types\n header: function (elem) {\n return rheader.test(elem.nodeName);\n },\n input: function (elem) {\n return rinputs.test(elem.nodeName);\n },\n button: function (elem) {\n return nodeName(elem, \"input\") && elem.type === \"button\" || nodeName(elem, \"button\");\n },\n text: function (elem) {\n var attr;\n return nodeName(elem, \"input\") && elem.type === \"text\" && (\n // Support: IE <10 only\n // New HTML5 attribute values (e.g., \"search\") appear\n // with elem.type === \"text\"\n (attr = elem.getAttribute(\"type\")) == null || attr.toLowerCase() === \"text\");\n },\n // Position-in-collection\n first: createPositionalPseudo(function () {\n return [0];\n }),\n last: createPositionalPseudo(function (_matchIndexes, length) {\n return [length - 1];\n }),\n eq: createPositionalPseudo(function (_matchIndexes, length, argument) {\n return [argument < 0 ? argument + length : argument];\n }),\n even: createPositionalPseudo(function (matchIndexes, length) {\n var i = 0;\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n return matchIndexes;\n }),\n odd: createPositionalPseudo(function (matchIndexes, length) {\n var i = 1;\n for (; i < length; i += 2) {\n matchIndexes.push(i);\n }\n return matchIndexes;\n }),\n lt: createPositionalPseudo(function (matchIndexes, length, argument) {\n var i;\n if (argument < 0) {\n i = argument + length;\n } else if (argument > length) {\n i = length;\n } else {\n i = argument;\n }\n for (; --i >= 0;) {\n matchIndexes.push(i);\n }\n return matchIndexes;\n }),\n gt: createPositionalPseudo(function (matchIndexes, length, argument) {\n var i = argument < 0 ? argument + length : argument;\n for (; ++i < length;) {\n matchIndexes.push(i);\n }\n return matchIndexes;\n })\n }\n };\n Expr.pseudos.nth = Expr.pseudos.eq;\n\n // Add button/input type pseudos\n for (i in {\n radio: true,\n checkbox: true,\n file: true,\n password: true,\n image: true\n }) {\n Expr.pseudos[i] = createInputPseudo(i);\n }\n for (i in {\n submit: true,\n reset: true\n }) {\n Expr.pseudos[i] = createButtonPseudo(i);\n }\n\n // Easy API for creating new setFilters\n function setFilters() {}\n setFilters.prototype = Expr.filters = Expr.pseudos;\n Expr.setFilters = new setFilters();\n function tokenize(selector, parseOnly) {\n var matched,\n match,\n tokens,\n type,\n soFar,\n groups,\n preFilters,\n cached = tokenCache[selector + \" \"];\n if (cached) {\n return parseOnly ? 0 : cached.slice(0);\n }\n soFar = selector;\n groups = [];\n preFilters = Expr.preFilter;\n while (soFar) {\n // Comma and first run\n if (!matched || (match = rcomma.exec(soFar))) {\n if (match) {\n // Don't consume trailing commas as valid\n soFar = soFar.slice(match[0].length) || soFar;\n }\n groups.push(tokens = []);\n }\n matched = false;\n\n // Combinators\n if (match = rleadingCombinator.exec(soFar)) {\n matched = match.shift();\n tokens.push({\n value: matched,\n // Cast descendant combinators to space\n type: match[0].replace(rtrimCSS, \" \")\n });\n soFar = soFar.slice(matched.length);\n }\n\n // Filters\n for (type in Expr.filter) {\n if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {\n matched = match.shift();\n tokens.push({\n value: matched,\n type: type,\n matches: match\n });\n soFar = soFar.slice(matched.length);\n }\n }\n if (!matched) {\n break;\n }\n }\n\n // Return the length of the invalid excess\n // if we're just parsing\n // Otherwise, throw an error or return tokens\n if (parseOnly) {\n return soFar.length;\n }\n return soFar ? find.error(selector) :\n // Cache the tokens\n tokenCache(selector, groups).slice(0);\n }\n function toSelector(tokens) {\n var i = 0,\n len = tokens.length,\n selector = \"\";\n for (; i < len; i++) {\n selector += tokens[i].value;\n }\n return selector;\n }\n function addCombinator(matcher, combinator, base) {\n var dir = combinator.dir,\n skip = combinator.next,\n key = skip || dir,\n checkNonElements = base && key === \"parentNode\",\n doneName = done++;\n return combinator.first ?\n // Check against closest ancestor/preceding element\n function (elem, context, xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n return matcher(elem, context, xml);\n }\n }\n return false;\n } :\n // Check against all ancestor/preceding elements\n function (elem, context, xml) {\n var oldCache,\n outerCache,\n newCache = [dirruns, doneName];\n\n // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\n if (xml) {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n if (matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n } else {\n while (elem = elem[dir]) {\n if (elem.nodeType === 1 || checkNonElements) {\n outerCache = elem[expando] || (elem[expando] = {});\n if (skip && nodeName(elem, skip)) {\n elem = elem[dir] || elem;\n } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {\n // Assign to newCache so results back-propagate to previous elements\n return newCache[2] = oldCache[2];\n } else {\n // Reuse newcache so results back-propagate to previous elements\n outerCache[key] = newCache;\n\n // A match means we're done; a fail means we have to keep checking\n if (newCache[2] = matcher(elem, context, xml)) {\n return true;\n }\n }\n }\n }\n }\n return false;\n };\n }\n function elementMatcher(matchers) {\n return matchers.length > 1 ? function (elem, context, xml) {\n var i = matchers.length;\n while (i--) {\n if (!matchers[i](elem, context, xml)) {\n return false;\n }\n }\n return true;\n } : matchers[0];\n }\n function multipleContexts(selector, contexts, results) {\n var i = 0,\n len = contexts.length;\n for (; i < len; i++) {\n find(selector, contexts[i], results);\n }\n return results;\n }\n function condense(unmatched, map, filter, context, xml) {\n var elem,\n newUnmatched = [],\n i = 0,\n len = unmatched.length,\n mapped = map != null;\n for (; i < len; i++) {\n if (elem = unmatched[i]) {\n if (!filter || filter(elem, context, xml)) {\n newUnmatched.push(elem);\n if (mapped) {\n map.push(i);\n }\n }\n }\n }\n return newUnmatched;\n }\n function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {\n if (postFilter && !postFilter[expando]) {\n postFilter = setMatcher(postFilter);\n }\n if (postFinder && !postFinder[expando]) {\n postFinder = setMatcher(postFinder, postSelector);\n }\n return markFunction(function (seed, results, context, xml) {\n var temp,\n i,\n elem,\n matcherOut,\n preMap = [],\n postMap = [],\n preexisting = results.length,\n // Get initial elements from seed or context\n elems = seed || multipleContexts(selector || \"*\", context.nodeType ? [context] : context, []),\n // Prefilter to get matcher input, preserving a map for seed-results synchronization\n matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;\n if (matcher) {\n // If we have a postFinder, or filtered seed, or non-seed postFilter\n // or preexisting results,\n matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ?\n // ...intermediate processing is necessary\n [] :\n // ...otherwise use results directly\n results;\n\n // Find primary matches\n matcher(matcherIn, matcherOut, context, xml);\n } else {\n matcherOut = matcherIn;\n }\n\n // Apply postFilter\n if (postFilter) {\n temp = condense(matcherOut, postMap);\n postFilter(temp, [], context, xml);\n\n // Un-match failing elements by moving them back to matcherIn\n i = temp.length;\n while (i--) {\n if (elem = temp[i]) {\n matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);\n }\n }\n }\n if (seed) {\n if (postFinder || preFilter) {\n if (postFinder) {\n // Get the final matcherOut by condensing this intermediate into postFinder contexts\n temp = [];\n i = matcherOut.length;\n while (i--) {\n if (elem = matcherOut[i]) {\n // Restore matcherIn since elem is not yet a final match\n temp.push(matcherIn[i] = elem);\n }\n }\n postFinder(null, matcherOut = [], temp, xml);\n }\n\n // Move matched elements from seed to results to keep them synchronized\n i = matcherOut.length;\n while (i--) {\n if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {\n seed[temp] = !(results[temp] = elem);\n }\n }\n }\n\n // Add elements to results, through postFinder if defined\n } else {\n matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);\n if (postFinder) {\n postFinder(null, results, matcherOut, xml);\n } else {\n push.apply(results, matcherOut);\n }\n }\n });\n }\n function matcherFromTokens(tokens) {\n var checkContext,\n matcher,\n j,\n len = tokens.length,\n leadingRelative = Expr.relative[tokens[0].type],\n implicitRelative = leadingRelative || Expr.relative[\" \"],\n i = leadingRelative ? 1 : 0,\n // The foundational matcher ensures that elements are reachable from top-level context(s)\n matchContext = addCombinator(function (elem) {\n return elem === checkContext;\n }, implicitRelative, true),\n matchAnyContext = addCombinator(function (elem) {\n return indexOf.call(checkContext, elem) > -1;\n }, implicitRelative, true),\n matchers = [function (elem, context, xml) {\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));\n\n // Avoid hanging onto element\n // (see https://github.com/jquery/sizzle/issues/299)\n checkContext = null;\n return ret;\n }];\n for (; i < len; i++) {\n if (matcher = Expr.relative[tokens[i].type]) {\n matchers = [addCombinator(elementMatcher(matchers), matcher)];\n } else {\n matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);\n\n // Return special upon seeing a positional matcher\n if (matcher[expando]) {\n // Find the next relative operator (if any) for proper handling\n j = ++i;\n for (; j < len; j++) {\n if (Expr.relative[tokens[j].type]) {\n break;\n }\n }\n return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(\n // If the preceding token was a descendant combinator, insert an implicit any-element `*`\n tokens.slice(0, i - 1).concat({\n value: tokens[i - 2].type === \" \" ? \"*\" : \"\"\n })).replace(rtrimCSS, \"$1\"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));\n }\n matchers.push(matcher);\n }\n }\n return elementMatcher(matchers);\n }\n function matcherFromGroupMatchers(elementMatchers, setMatchers) {\n var bySet = setMatchers.length > 0,\n byElement = elementMatchers.length > 0,\n superMatcher = function (seed, context, xml, results, outermost) {\n var elem,\n j,\n matcher,\n matchedCount = 0,\n i = \"0\",\n unmatched = seed && [],\n setMatched = [],\n contextBackup = outermostContext,\n // We must always have either seed elements or outermost context\n elems = seed || byElement && Expr.find.TAG(\"*\", outermost),\n // Use integer dirruns iff this is the outermost matcher\n dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1,\n len = elems.length;\n if (outermost) {\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n outermostContext = context == document || context || outermost;\n }\n\n // Add elements passing elementMatchers directly to results\n // Support: iOS <=7 - 9 only\n // Tolerate NodeList properties (IE: \"length\"; Safari: ) matching\n // elements by id. (see trac-14142)\n for (; i !== len && (elem = elems[i]) != null; i++) {\n if (byElement && elem) {\n j = 0;\n\n // Support: IE 11+, Edge 17 - 18+\n // IE/Edge sometimes throw a \"Permission denied\" error when strict-comparing\n // two documents; shallow comparisons work.\n // eslint-disable-next-line eqeqeq\n if (!context && elem.ownerDocument != document) {\n setDocument(elem);\n xml = !documentIsHTML;\n }\n while (matcher = elementMatchers[j++]) {\n if (matcher(elem, context || document, xml)) {\n push.call(results, elem);\n break;\n }\n }\n if (outermost) {\n dirruns = dirrunsUnique;\n }\n }\n\n // Track unmatched elements for set filters\n if (bySet) {\n // They will have gone through all possible matchers\n if (elem = !matcher && elem) {\n matchedCount--;\n }\n\n // Lengthen the array for every element, matched or not\n if (seed) {\n unmatched.push(elem);\n }\n }\n }\n\n // `i` is now the count of elements visited above, and adding it to `matchedCount`\n // makes the latter nonnegative.\n matchedCount += i;\n\n // Apply set filters to unmatched elements\n // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\n // no element matchers and no seed.\n // Incrementing an initially-string \"0\" `i` allows `i` to remain a string only in that\n // case, which will result in a \"00\" `matchedCount` that differs from `i` but is also\n // numerically zero.\n if (bySet && i !== matchedCount) {\n j = 0;\n while (matcher = setMatchers[j++]) {\n matcher(unmatched, setMatched, context, xml);\n }\n if (seed) {\n // Reintegrate element matches to eliminate the need for sorting\n if (matchedCount > 0) {\n while (i--) {\n if (!(unmatched[i] || setMatched[i])) {\n setMatched[i] = pop.call(results);\n }\n }\n }\n\n // Discard index placeholder values to get only actual matches\n setMatched = condense(setMatched);\n }\n\n // Add matches to results\n push.apply(results, setMatched);\n\n // Seedless set matches succeeding multiple successful matchers stipulate sorting\n if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {\n jQuery.uniqueSort(results);\n }\n }\n\n // Override manipulation of globals by nested matchers\n if (outermost) {\n dirruns = dirrunsUnique;\n outermostContext = contextBackup;\n }\n return unmatched;\n };\n return bySet ? markFunction(superMatcher) : superMatcher;\n }\n function compile(selector, match /* Internal Use Only */) {\n var i,\n setMatchers = [],\n elementMatchers = [],\n cached = compilerCache[selector + \" \"];\n if (!cached) {\n // Generate a function of recursive functions that can be used to check each element\n if (!match) {\n match = tokenize(selector);\n }\n i = match.length;\n while (i--) {\n cached = matcherFromTokens(match[i]);\n if (cached[expando]) {\n setMatchers.push(cached);\n } else {\n elementMatchers.push(cached);\n }\n }\n\n // Cache the compiled function\n cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));\n\n // Save selector and tokenization\n cached.selector = selector;\n }\n return cached;\n }\n\n /**\n * A low-level selection function that works with jQuery's compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with jQuery selector compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\n function select(selector, context, results, seed) {\n var i,\n tokens,\n token,\n type,\n find,\n compiled = typeof selector === \"function\" && selector,\n match = !seed && tokenize(selector = compiled.selector || selector);\n results = results || [];\n\n // Try to minimize operations if there is only one selector in the list and no seed\n // (the latter of which guarantees us context)\n if (match.length === 1) {\n // Reduce context if the leading compound selector is an ID\n tokens = match[0] = match[0].slice(0);\n if (tokens.length > 2 && (token = tokens[0]).type === \"ID\" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {\n context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];\n if (!context) {\n return results;\n\n // Precompiled matchers will still verify ancestry, so step up a level\n } else if (compiled) {\n context = context.parentNode;\n }\n selector = selector.slice(tokens.shift().value.length);\n }\n\n // Fetch a seed set for right-to-left matching\n i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;\n while (i--) {\n token = tokens[i];\n\n // Abort if we hit a combinator\n if (Expr.relative[type = token.type]) {\n break;\n }\n if (find = Expr.find[type]) {\n // Search, expanding context for leading sibling combinators\n if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {\n // If seed is empty or no tokens remain, we can return early\n tokens.splice(i, 1);\n selector = seed.length && toSelector(tokens);\n if (!selector) {\n push.apply(results, seed);\n return results;\n }\n break;\n }\n }\n }\n }\n\n // Compile and execute a filtering function if one is not provided\n // Provide `match` to avoid retokenization if we modified the selector above\n (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context);\n return results;\n }\n\n // One-time assignments\n\n // Support: Android <=4.0 - 4.1+\n // Sort stability\n support.sortStable = expando.split(\"\").sort(sortOrder).join(\"\") === expando;\n\n // Initialize against the default document\n setDocument();\n\n // Support: Android <=4.0 - 4.1+\n // Detached nodes confoundingly follow *each other*\n support.sortDetached = assert(function (el) {\n // Should return 1, but returns 4 (following)\n return el.compareDocumentPosition(document.createElement(\"fieldset\")) & 1;\n });\n jQuery.find = find;\n\n // Deprecated\n jQuery.expr[\":\"] = jQuery.expr.pseudos;\n jQuery.unique = jQuery.uniqueSort;\n\n // These have always been private, but they used to be documented as part of\n // Sizzle so let's maintain them for now for backwards compatibility purposes.\n find.compile = compile;\n find.select = select;\n find.setDocument = setDocument;\n find.tokenize = tokenize;\n find.escape = jQuery.escapeSelector;\n find.getText = jQuery.text;\n find.isXML = jQuery.isXMLDoc;\n find.selectors = jQuery.expr;\n find.support = jQuery.support;\n find.uniqueSort = jQuery.uniqueSort;\n\n /* eslint-enable */\n })();\n var dir = function (elem, dir, until) {\n var matched = [],\n truncate = until !== undefined;\n while ((elem = elem[dir]) && elem.nodeType !== 9) {\n if (elem.nodeType === 1) {\n if (truncate && jQuery(elem).is(until)) {\n break;\n }\n matched.push(elem);\n }\n }\n return matched;\n };\n var siblings = function (n, elem) {\n var matched = [];\n for (; n; n = n.nextSibling) {\n if (n.nodeType === 1 && n !== elem) {\n matched.push(n);\n }\n }\n return matched;\n };\n var rneedsContext = jQuery.expr.match.needsContext;\n var rsingleTag = /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i;\n\n // Implement the identical functionality for filter and not\n function winnow(elements, qualifier, not) {\n if (isFunction(qualifier)) {\n return jQuery.grep(elements, function (elem, i) {\n return !!qualifier.call(elem, i, elem) !== not;\n });\n }\n\n // Single element\n if (qualifier.nodeType) {\n return jQuery.grep(elements, function (elem) {\n return elem === qualifier !== not;\n });\n }\n\n // Arraylike of elements (jQuery, arguments, Array)\n if (typeof qualifier !== \"string\") {\n return jQuery.grep(elements, function (elem) {\n return indexOf.call(qualifier, elem) > -1 !== not;\n });\n }\n\n // Filtered directly for both simple and complex selectors\n return jQuery.filter(qualifier, elements, not);\n }\n jQuery.filter = function (expr, elems, not) {\n var elem = elems[0];\n if (not) {\n expr = \":not(\" + expr + \")\";\n }\n if (elems.length === 1 && elem.nodeType === 1) {\n return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];\n }\n return jQuery.find.matches(expr, jQuery.grep(elems, function (elem) {\n return elem.nodeType === 1;\n }));\n };\n jQuery.fn.extend({\n find: function (selector) {\n var i,\n ret,\n len = this.length,\n self = this;\n if (typeof selector !== \"string\") {\n return this.pushStack(jQuery(selector).filter(function () {\n for (i = 0; i < len; i++) {\n if (jQuery.contains(self[i], this)) {\n return true;\n }\n }\n }));\n }\n ret = this.pushStack([]);\n for (i = 0; i < len; i++) {\n jQuery.find(selector, self[i], ret);\n }\n return len > 1 ? jQuery.uniqueSort(ret) : ret;\n },\n filter: function (selector) {\n return this.pushStack(winnow(this, selector || [], false));\n },\n not: function (selector) {\n return this.pushStack(winnow(this, selector || [], true));\n },\n is: function (selector) {\n return !!winnow(this,\n // If this is a positional/relative selector, check membership in the returned set\n // so $(\"p:first\").is(\"p:last\") won't return true for a doc with two \"p\".\n typeof selector === \"string\" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;\n }\n });\n\n // Initialize a jQuery object\n\n // A central reference to the root jQuery(document)\n var rootjQuery,\n // A simple way to check for HTML strings\n // Prioritize #id over to avoid XSS via location.hash (trac-9521)\n // Strict HTML recognition (trac-11290: must start with <)\n // Shortcut simple #id case for speed\n rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n init = jQuery.fn.init = function (selector, context, root) {\n var match, elem;\n\n // HANDLE: $(\"\"), $(null), $(undefined), $(false)\n if (!selector) {\n return this;\n }\n\n // Method init() accepts an alternate rootjQuery\n // so migrate can support jQuery.sub (gh-2101)\n root = root || rootjQuery;\n\n // Handle HTML strings\n if (typeof selector === \"string\") {\n if (selector[0] === \"<\" && selector[selector.length - 1] === \">\" && selector.length >= 3) {\n // Assume that strings that start and end with <> are HTML and skip the regex check\n match = [null, selector, null];\n } else {\n match = rquickExpr.exec(selector);\n }\n\n // Match html or make sure no context is specified for #id\n if (match && (match[1] || !context)) {\n // HANDLE: $(html) -> $(array)\n if (match[1]) {\n context = context instanceof jQuery ? context[0] : context;\n\n // Option to run scripts is true for back-compat\n // Intentionally let the error be thrown if parseHTML is not present\n jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true));\n\n // HANDLE: $(html, props)\n if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {\n for (match in context) {\n // Properties of context are called as methods if possible\n if (isFunction(this[match])) {\n this[match](context[match]);\n\n // ...and otherwise set as attributes\n } else {\n this.attr(match, context[match]);\n }\n }\n }\n return this;\n\n // HANDLE: $(#id)\n } else {\n elem = document.getElementById(match[2]);\n if (elem) {\n // Inject the element directly into the jQuery object\n this[0] = elem;\n this.length = 1;\n }\n return this;\n }\n\n // HANDLE: $(expr, $(...))\n } else if (!context || context.jquery) {\n return (context || root).find(selector);\n\n // HANDLE: $(expr, context)\n // (which is just equivalent to: $(context).find(expr)\n } else {\n return this.constructor(context).find(selector);\n }\n\n // HANDLE: $(DOMElement)\n } else if (selector.nodeType) {\n this[0] = selector;\n this.length = 1;\n return this;\n\n // HANDLE: $(function)\n // Shortcut for document ready\n } else if (isFunction(selector)) {\n return root.ready !== undefined ? root.ready(selector) :\n // Execute immediately if ready is not present\n selector(jQuery);\n }\n return jQuery.makeArray(selector, this);\n };\n\n // Give the init function the jQuery prototype for later instantiation\n init.prototype = jQuery.fn;\n\n // Initialize central reference\n rootjQuery = jQuery(document);\n var rparentsprev = /^(?:parents|prev(?:Until|All))/,\n // Methods guaranteed to produce a unique set when starting from a unique set\n guaranteedUnique = {\n children: true,\n contents: true,\n next: true,\n prev: true\n };\n jQuery.fn.extend({\n has: function (target) {\n var targets = jQuery(target, this),\n l = targets.length;\n return this.filter(function () {\n var i = 0;\n for (; i < l; i++) {\n if (jQuery.contains(this, targets[i])) {\n return true;\n }\n }\n });\n },\n closest: function (selectors, context) {\n var cur,\n i = 0,\n l = this.length,\n matched = [],\n targets = typeof selectors !== \"string\" && jQuery(selectors);\n\n // Positional selectors never match, since there's no _selection_ context\n if (!rneedsContext.test(selectors)) {\n for (; i < l; i++) {\n for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {\n // Always skip document fragments\n if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 :\n // Don't pass non-elements to jQuery#find\n cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {\n matched.push(cur);\n break;\n }\n }\n }\n }\n return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);\n },\n // Determine the position of an element within the set\n index: function (elem) {\n // No argument, return index in parent\n if (!elem) {\n return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;\n }\n\n // Index in selector\n if (typeof elem === \"string\") {\n return indexOf.call(jQuery(elem), this[0]);\n }\n\n // Locate the position of the desired element\n return indexOf.call(this,\n // If it receives a jQuery object, the first element is used\n elem.jquery ? elem[0] : elem);\n },\n add: function (selector, context) {\n return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context))));\n },\n addBack: function (selector) {\n return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector));\n }\n });\n function sibling(cur, dir) {\n while ((cur = cur[dir]) && cur.nodeType !== 1) {}\n return cur;\n }\n jQuery.each({\n parent: function (elem) {\n var parent = elem.parentNode;\n return parent && parent.nodeType !== 11 ? parent : null;\n },\n parents: function (elem) {\n return dir(elem, \"parentNode\");\n },\n parentsUntil: function (elem, _i, until) {\n return dir(elem, \"parentNode\", until);\n },\n next: function (elem) {\n return sibling(elem, \"nextSibling\");\n },\n prev: function (elem) {\n return sibling(elem, \"previousSibling\");\n },\n nextAll: function (elem) {\n return dir(elem, \"nextSibling\");\n },\n prevAll: function (elem) {\n return dir(elem, \"previousSibling\");\n },\n nextUntil: function (elem, _i, until) {\n return dir(elem, \"nextSibling\", until);\n },\n prevUntil: function (elem, _i, until) {\n return dir(elem, \"previousSibling\", until);\n },\n siblings: function (elem) {\n return siblings((elem.parentNode || {}).firstChild, elem);\n },\n children: function (elem) {\n return siblings(elem.firstChild);\n },\n contents: function (elem) {\n if (elem.contentDocument != null &&\n // Support: IE 11+\n // elements with no `data` attribute has an object\n // `contentDocument` with a `null` prototype.\n getProto(elem.contentDocument)) {\n return elem.contentDocument;\n }\n\n // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n // Treat the template element as a regular one in browsers that\n // don't support it.\n if (nodeName(elem, \"template\")) {\n elem = elem.content || elem;\n }\n return jQuery.merge([], elem.childNodes);\n }\n }, function (name, fn) {\n jQuery.fn[name] = function (until, selector) {\n var matched = jQuery.map(this, fn, until);\n if (name.slice(-5) !== \"Until\") {\n selector = until;\n }\n if (selector && typeof selector === \"string\") {\n matched = jQuery.filter(selector, matched);\n }\n if (this.length > 1) {\n // Remove duplicates\n if (!guaranteedUnique[name]) {\n jQuery.uniqueSort(matched);\n }\n\n // Reverse order for parents* and prev-derivatives\n if (rparentsprev.test(name)) {\n matched.reverse();\n }\n }\n return this.pushStack(matched);\n };\n });\n var rnothtmlwhite = /[^\\x20\\t\\r\\n\\f]+/g;\n\n // Convert String-formatted options into Object-formatted ones\n function createOptions(options) {\n var object = {};\n jQuery.each(options.match(rnothtmlwhite) || [], function (_, flag) {\n object[flag] = true;\n });\n return object;\n }\n\n /*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * \"fired\" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\n jQuery.Callbacks = function (options) {\n // Convert options from String-formatted to Object-formatted if needed\n // (we check in cache first)\n options = typeof options === \"string\" ? createOptions(options) : jQuery.extend({}, options);\n var\n // Flag to know if list is currently firing\n firing,\n // Last fire value for non-forgettable lists\n memory,\n // Flag to know if list was already fired\n fired,\n // Flag to prevent firing\n locked,\n // Actual callback list\n list = [],\n // Queue of execution data for repeatable lists\n queue = [],\n // Index of currently firing callback (modified by add/remove as needed)\n firingIndex = -1,\n // Fire callbacks\n fire = function () {\n // Enforce single-firing\n locked = locked || options.once;\n\n // Execute callbacks for all pending executions,\n // respecting firingIndex overrides and runtime changes\n fired = firing = true;\n for (; queue.length; firingIndex = -1) {\n memory = queue.shift();\n while (++firingIndex < list.length) {\n // Run callback and check for early termination\n if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {\n // Jump to end and forget the data so .add doesn't re-fire\n firingIndex = list.length;\n memory = false;\n }\n }\n }\n\n // Forget the data if we're done with it\n if (!options.memory) {\n memory = false;\n }\n firing = false;\n\n // Clean up if we're done firing for good\n if (locked) {\n // Keep an empty list if we have data for future add calls\n if (memory) {\n list = [];\n\n // Otherwise, this object is spent\n } else {\n list = \"\";\n }\n }\n },\n // Actual Callbacks object\n self = {\n // Add a callback or a collection of callbacks to the list\n add: function () {\n if (list) {\n // If we have memory from a past run, we should fire after adding\n if (memory && !firing) {\n firingIndex = list.length - 1;\n queue.push(memory);\n }\n (function add(args) {\n jQuery.each(args, function (_, arg) {\n if (isFunction(arg)) {\n if (!options.unique || !self.has(arg)) {\n list.push(arg);\n }\n } else if (arg && arg.length && toType(arg) !== \"string\") {\n // Inspect recursively\n add(arg);\n }\n });\n })(arguments);\n if (memory && !firing) {\n fire();\n }\n }\n return this;\n },\n // Remove a callback from the list\n remove: function () {\n jQuery.each(arguments, function (_, arg) {\n var index;\n while ((index = jQuery.inArray(arg, list, index)) > -1) {\n list.splice(index, 1);\n\n // Handle firing indexes\n if (index <= firingIndex) {\n firingIndex--;\n }\n }\n });\n return this;\n },\n // Check if a given callback is in the list.\n // If no argument is given, return whether or not list has callbacks attached.\n has: function (fn) {\n return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;\n },\n // Remove all callbacks from the list\n empty: function () {\n if (list) {\n list = [];\n }\n return this;\n },\n // Disable .fire and .add\n // Abort any current/pending executions\n // Clear all callbacks and values\n disable: function () {\n locked = queue = [];\n list = memory = \"\";\n return this;\n },\n disabled: function () {\n return !list;\n },\n // Disable .fire\n // Also disable .add unless we have memory (since it would have no effect)\n // Abort any pending executions\n lock: function () {\n locked = queue = [];\n if (!memory && !firing) {\n list = memory = \"\";\n }\n return this;\n },\n locked: function () {\n return !!locked;\n },\n // Call all callbacks with the given context and arguments\n fireWith: function (context, args) {\n if (!locked) {\n args = args || [];\n args = [context, args.slice ? args.slice() : args];\n queue.push(args);\n if (!firing) {\n fire();\n }\n }\n return this;\n },\n // Call all the callbacks with the given arguments\n fire: function () {\n self.fireWith(this, arguments);\n return this;\n },\n // To know if the callbacks have already been called at least once\n fired: function () {\n return !!fired;\n }\n };\n return self;\n };\n function Identity(v) {\n return v;\n }\n function Thrower(ex) {\n throw ex;\n }\n function adoptValue(value, resolve, reject, noValue) {\n var method;\n try {\n // Check for promise aspect first to privilege synchronous behavior\n if (value && isFunction(method = value.promise)) {\n method.call(value).done(resolve).fail(reject);\n\n // Other thenables\n } else if (value && isFunction(method = value.then)) {\n method.call(value, resolve, reject);\n\n // Other non-thenables\n } else {\n // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n // * false: [ value ].slice( 0 ) => resolve( value )\n // * true: [ value ].slice( 1 ) => resolve()\n resolve.apply(undefined, [value].slice(noValue));\n }\n\n // For Promises/A+, convert exceptions into rejections\n // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\n // Deferred#then to conditionally suppress rejection.\n } catch (value) {\n // Support: Android 4.0 only\n // Strict mode functions invoked without .call/.apply get global-object context\n reject.apply(undefined, [value]);\n }\n }\n jQuery.extend({\n Deferred: function (func) {\n var tuples = [\n // action, add listener, callbacks,\n // ... .then handlers, argument index, [final state]\n [\"notify\", \"progress\", jQuery.Callbacks(\"memory\"), jQuery.Callbacks(\"memory\"), 2], [\"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), jQuery.Callbacks(\"once memory\"), 0, \"resolved\"], [\"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), jQuery.Callbacks(\"once memory\"), 1, \"rejected\"]],\n state = \"pending\",\n promise = {\n state: function () {\n return state;\n },\n always: function () {\n deferred.done(arguments).fail(arguments);\n return this;\n },\n \"catch\": function (fn) {\n return promise.then(null, fn);\n },\n // Keep pipe for back-compat\n pipe: function /* fnDone, fnFail, fnProgress */\n () {\n var fns = arguments;\n return jQuery.Deferred(function (newDefer) {\n jQuery.each(tuples, function (_i, tuple) {\n // Map tuples (progress, done, fail) to arguments (done, fail, progress)\n var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]];\n\n // deferred.progress(function() { bind to newDefer or newDefer.notify })\n // deferred.done(function() { bind to newDefer or newDefer.resolve })\n // deferred.fail(function() { bind to newDefer or newDefer.reject })\n deferred[tuple[1]](function () {\n var returned = fn && fn.apply(this, arguments);\n if (returned && isFunction(returned.promise)) {\n returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);\n } else {\n newDefer[tuple[0] + \"With\"](this, fn ? [returned] : arguments);\n }\n });\n });\n fns = null;\n }).promise();\n },\n then: function (onFulfilled, onRejected, onProgress) {\n var maxDepth = 0;\n function resolve(depth, deferred, handler, special) {\n return function () {\n var that = this,\n args = arguments,\n mightThrow = function () {\n var returned, then;\n\n // Support: Promises/A+ section 2.3.3.3.3\n // https://promisesaplus.com/#point-59\n // Ignore double-resolution attempts\n if (depth < maxDepth) {\n return;\n }\n returned = handler.apply(that, args);\n\n // Support: Promises/A+ section 2.3.1\n // https://promisesaplus.com/#point-48\n if (returned === deferred.promise()) {\n throw new TypeError(\"Thenable self-resolution\");\n }\n\n // Support: Promises/A+ sections 2.3.3.1, 3.5\n // https://promisesaplus.com/#point-54\n // https://promisesaplus.com/#point-75\n // Retrieve `then` only once\n then = returned && (\n // Support: Promises/A+ section 2.3.4\n // https://promisesaplus.com/#point-64\n // Only check objects and functions for thenability\n typeof returned === \"object\" || typeof returned === \"function\") && returned.then;\n\n // Handle a returned thenable\n if (isFunction(then)) {\n // Special processors (notify) just wait for resolution\n if (special) {\n then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special));\n\n // Normal processors (resolve) also hook into progress\n } else {\n // ...and disregard older resolution values\n maxDepth++;\n then.call(returned, resolve(maxDepth, deferred, Identity, special), resolve(maxDepth, deferred, Thrower, special), resolve(maxDepth, deferred, Identity, deferred.notifyWith));\n }\n\n // Handle all other returned values\n } else {\n // Only substitute handlers pass on context\n // and multiple values (non-spec behavior)\n if (handler !== Identity) {\n that = undefined;\n args = [returned];\n }\n\n // Process the value(s)\n // Default process is resolve\n (special || deferred.resolveWith)(that, args);\n }\n },\n // Only normal processors (resolve) catch and reject exceptions\n process = special ? mightThrow : function () {\n try {\n mightThrow();\n } catch (e) {\n if (jQuery.Deferred.exceptionHook) {\n jQuery.Deferred.exceptionHook(e, process.error);\n }\n\n // Support: Promises/A+ section 2.3.3.3.4.1\n // https://promisesaplus.com/#point-61\n // Ignore post-resolution exceptions\n if (depth + 1 >= maxDepth) {\n // Only substitute handlers pass on context\n // and multiple values (non-spec behavior)\n if (handler !== Thrower) {\n that = undefined;\n args = [e];\n }\n deferred.rejectWith(that, args);\n }\n }\n };\n\n // Support: Promises/A+ section 2.3.3.3.1\n // https://promisesaplus.com/#point-57\n // Re-resolve promises immediately to dodge false rejection from\n // subsequent errors\n if (depth) {\n process();\n } else {\n // Call an optional hook to record the error, in case of exception\n // since it's otherwise lost when execution goes async\n if (jQuery.Deferred.getErrorHook) {\n process.error = jQuery.Deferred.getErrorHook();\n\n // The deprecated alias of the above. While the name suggests\n // returning the stack, not an error instance, jQuery just passes\n // it directly to `console.warn` so both will work; an instance\n // just better cooperates with source maps.\n } else if (jQuery.Deferred.getStackHook) {\n process.error = jQuery.Deferred.getStackHook();\n }\n window.setTimeout(process);\n }\n };\n }\n return jQuery.Deferred(function (newDefer) {\n // progress_handlers.add( ... )\n tuples[0][3].add(resolve(0, newDefer, isFunction(onProgress) ? onProgress : Identity, newDefer.notifyWith));\n\n // fulfilled_handlers.add( ... )\n tuples[1][3].add(resolve(0, newDefer, isFunction(onFulfilled) ? onFulfilled : Identity));\n\n // rejected_handlers.add( ... )\n tuples[2][3].add(resolve(0, newDefer, isFunction(onRejected) ? onRejected : Thrower));\n }).promise();\n },\n // Get a promise for this deferred\n // If obj is provided, the promise aspect is added to the object\n promise: function (obj) {\n return obj != null ? jQuery.extend(obj, promise) : promise;\n }\n },\n deferred = {};\n\n // Add list-specific methods\n jQuery.each(tuples, function (i, tuple) {\n var list = tuple[2],\n stateString = tuple[5];\n\n // promise.progress = list.add\n // promise.done = list.add\n // promise.fail = list.add\n promise[tuple[1]] = list.add;\n\n // Handle state\n if (stateString) {\n list.add(function () {\n // state = \"resolved\" (i.e., fulfilled)\n // state = \"rejected\"\n state = stateString;\n },\n // rejected_callbacks.disable\n // fulfilled_callbacks.disable\n tuples[3 - i][2].disable,\n // rejected_handlers.disable\n // fulfilled_handlers.disable\n tuples[3 - i][3].disable,\n // progress_callbacks.lock\n tuples[0][2].lock,\n // progress_handlers.lock\n tuples[0][3].lock);\n }\n\n // progress_handlers.fire\n // fulfilled_handlers.fire\n // rejected_handlers.fire\n list.add(tuple[3].fire);\n\n // deferred.notify = function() { deferred.notifyWith(...) }\n // deferred.resolve = function() { deferred.resolveWith(...) }\n // deferred.reject = function() { deferred.rejectWith(...) }\n deferred[tuple[0]] = function () {\n deferred[tuple[0] + \"With\"](this === deferred ? undefined : this, arguments);\n return this;\n };\n\n // deferred.notifyWith = list.fireWith\n // deferred.resolveWith = list.fireWith\n // deferred.rejectWith = list.fireWith\n deferred[tuple[0] + \"With\"] = list.fireWith;\n });\n\n // Make the deferred a promise\n promise.promise(deferred);\n\n // Call given func if any\n if (func) {\n func.call(deferred, deferred);\n }\n\n // All done!\n return deferred;\n },\n // Deferred helper\n when: function (singleValue) {\n var\n // count of uncompleted subordinates\n remaining = arguments.length,\n // count of unprocessed arguments\n i = remaining,\n // subordinate fulfillment data\n resolveContexts = Array(i),\n resolveValues = slice.call(arguments),\n // the primary Deferred\n primary = jQuery.Deferred(),\n // subordinate callback factory\n updateFunc = function (i) {\n return function (value) {\n resolveContexts[i] = this;\n resolveValues[i] = arguments.length > 1 ? slice.call(arguments) : value;\n if (! --remaining) {\n primary.resolveWith(resolveContexts, resolveValues);\n }\n };\n };\n\n // Single- and empty arguments are adopted like Promise.resolve\n if (remaining <= 1) {\n adoptValue(singleValue, primary.done(updateFunc(i)).resolve, primary.reject, !remaining);\n\n // Use .then() to unwrap secondary thenables (cf. gh-3000)\n if (primary.state() === \"pending\" || isFunction(resolveValues[i] && resolveValues[i].then)) {\n return primary.then();\n }\n }\n\n // Multiple arguments are aggregated like Promise.all array elements\n while (i--) {\n adoptValue(resolveValues[i], updateFunc(i), primary.reject);\n }\n return primary.promise();\n }\n });\n\n // These usually indicate a programmer mistake during development,\n // warn about them ASAP rather than swallowing them by default.\n var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\n // If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error\n // captured before the async barrier to get the original error cause\n // which may otherwise be hidden.\n jQuery.Deferred.exceptionHook = function (error, asyncError) {\n // Support: IE 8 - 9 only\n // Console exists when dev tools are open, which can happen at any time\n if (window.console && window.console.warn && error && rerrorNames.test(error.name)) {\n window.console.warn(\"jQuery.Deferred exception: \" + error.message, error.stack, asyncError);\n }\n };\n jQuery.readyException = function (error) {\n window.setTimeout(function () {\n throw error;\n });\n };\n\n // The deferred used on DOM ready\n var readyList = jQuery.Deferred();\n jQuery.fn.ready = function (fn) {\n readyList.then(fn)\n\n // Wrap jQuery.readyException in a function so that the lookup\n // happens at the time of error handling instead of callback\n // registration.\n .catch(function (error) {\n jQuery.readyException(error);\n });\n return this;\n };\n jQuery.extend({\n // Is the DOM ready to be used? Set to true once it occurs.\n isReady: false,\n // A counter to track how many items to wait for before\n // the ready event fires. See trac-6781\n readyWait: 1,\n // Handle when the DOM is ready\n ready: function (wait) {\n // Abort if there are pending holds or we're already ready\n if (wait === true ? --jQuery.readyWait : jQuery.isReady) {\n return;\n }\n\n // Remember that the DOM is ready\n jQuery.isReady = true;\n\n // If a normal DOM Ready event fired, decrement, and wait if need be\n if (wait !== true && --jQuery.readyWait > 0) {\n return;\n }\n\n // If there are functions bound, to execute\n readyList.resolveWith(document, [jQuery]);\n }\n });\n jQuery.ready.then = readyList.then;\n\n // The ready event handler and self cleanup method\n function completed() {\n document.removeEventListener(\"DOMContentLoaded\", completed);\n window.removeEventListener(\"load\", completed);\n jQuery.ready();\n }\n\n // Catch cases where $(document).ready() is called\n // after the browser event has already occurred.\n // Support: IE <=9 - 10 only\n // Older IE sometimes signals \"interactive\" too soon\n if (document.readyState === \"complete\" || document.readyState !== \"loading\" && !document.documentElement.doScroll) {\n // Handle it asynchronously to allow scripts the opportunity to delay ready\n window.setTimeout(jQuery.ready);\n } else {\n // Use the handy event callback\n document.addEventListener(\"DOMContentLoaded\", completed);\n\n // A fallback to window.onload, that will always work\n window.addEventListener(\"load\", completed);\n }\n\n // Multifunctional method to get and set values of a collection\n // The value/s can optionally be executed if it's a function\n var access = function (elems, fn, key, value, chainable, emptyGet, raw) {\n var i = 0,\n len = elems.length,\n bulk = key == null;\n\n // Sets many values\n if (toType(key) === \"object\") {\n chainable = true;\n for (i in key) {\n access(elems, fn, i, key[i], true, emptyGet, raw);\n }\n\n // Sets one value\n } else if (value !== undefined) {\n chainable = true;\n if (!isFunction(value)) {\n raw = true;\n }\n if (bulk) {\n // Bulk operations run against the entire set\n if (raw) {\n fn.call(elems, value);\n fn = null;\n\n // ...except when executing function values\n } else {\n bulk = fn;\n fn = function (elem, _key, value) {\n return bulk.call(jQuery(elem), value);\n };\n }\n }\n if (fn) {\n for (; i < len; i++) {\n fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));\n }\n }\n }\n if (chainable) {\n return elems;\n }\n\n // Gets\n if (bulk) {\n return fn.call(elems);\n }\n return len ? fn(elems[0], key) : emptyGet;\n };\n\n // Matches dashed string for camelizing\n var rmsPrefix = /^-ms-/,\n rdashAlpha = /-([a-z])/g;\n\n // Used by camelCase as callback to replace()\n function fcamelCase(_all, letter) {\n return letter.toUpperCase();\n }\n\n // Convert dashed to camelCase; used by the css and data modules\n // Support: IE <=9 - 11, Edge 12 - 15\n // Microsoft forgot to hump their vendor prefix (trac-9572)\n function camelCase(string) {\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\n }\n var acceptData = function (owner) {\n // Accepts only:\n // - Node\n // - Node.ELEMENT_NODE\n // - Node.DOCUMENT_NODE\n // - Object\n // - Any\n return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;\n };\n function Data() {\n this.expando = jQuery.expando + Data.uid++;\n }\n Data.uid = 1;\n Data.prototype = {\n cache: function (owner) {\n // Check if the owner object already has a cache\n var value = owner[this.expando];\n\n // If not, create one\n if (!value) {\n value = {};\n\n // We can accept data for non-element nodes in modern browsers,\n // but we should not, see trac-8335.\n // Always return an empty object.\n if (acceptData(owner)) {\n // If it is a node unlikely to be stringify-ed or looped over\n // use plain assignment\n if (owner.nodeType) {\n owner[this.expando] = value;\n\n // Otherwise secure it in a non-enumerable property\n // configurable must be true to allow the property to be\n // deleted when data is removed\n } else {\n Object.defineProperty(owner, this.expando, {\n value: value,\n configurable: true\n });\n }\n }\n }\n return value;\n },\n set: function (owner, data, value) {\n var prop,\n cache = this.cache(owner);\n\n // Handle: [ owner, key, value ] args\n // Always use camelCase key (gh-2257)\n if (typeof data === \"string\") {\n cache[camelCase(data)] = value;\n\n // Handle: [ owner, { properties } ] args\n } else {\n // Copy the properties one-by-one to the cache object\n for (prop in data) {\n cache[camelCase(prop)] = data[prop];\n }\n }\n return cache;\n },\n get: function (owner, key) {\n return key === undefined ? this.cache(owner) :\n // Always use camelCase key (gh-2257)\n owner[this.expando] && owner[this.expando][camelCase(key)];\n },\n access: function (owner, key, value) {\n // In cases where either:\n //\n // 1. No key was specified\n // 2. A string key was specified, but no value provided\n //\n // Take the \"read\" path and allow the get method to determine\n // which value to return, respectively either:\n //\n // 1. The entire cache object\n // 2. The data stored at the key\n //\n if (key === undefined || key && typeof key === \"string\" && value === undefined) {\n return this.get(owner, key);\n }\n\n // When the key is not a string, or both a key and value\n // are specified, set or extend (existing objects) with either:\n //\n // 1. An object of properties\n // 2. A key and value\n //\n this.set(owner, key, value);\n\n // Since the \"set\" path can have two possible entry points\n // return the expected data based on which path was taken[*]\n return value !== undefined ? value : key;\n },\n remove: function (owner, key) {\n var i,\n cache = owner[this.expando];\n if (cache === undefined) {\n return;\n }\n if (key !== undefined) {\n // Support array or space separated string of keys\n if (Array.isArray(key)) {\n // If key is an array of keys...\n // We always set camelCase keys, so remove that.\n key = key.map(camelCase);\n } else {\n key = camelCase(key);\n\n // If a key with the spaces exists, use it.\n // Otherwise, create an array by matching non-whitespace\n key = key in cache ? [key] : key.match(rnothtmlwhite) || [];\n }\n i = key.length;\n while (i--) {\n delete cache[key[i]];\n }\n }\n\n // Remove the expando if there's no more data\n if (key === undefined || jQuery.isEmptyObject(cache)) {\n // Support: Chrome <=35 - 45\n // Webkit & Blink performance suffers when deleting properties\n // from DOM nodes, so set to undefined instead\n // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n if (owner.nodeType) {\n owner[this.expando] = undefined;\n } else {\n delete owner[this.expando];\n }\n }\n },\n hasData: function (owner) {\n var cache = owner[this.expando];\n return cache !== undefined && !jQuery.isEmptyObject(cache);\n }\n };\n var dataPriv = new Data();\n var dataUser = new Data();\n\n //\tImplementation Summary\n //\n //\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n //\t2. Improve the module's maintainability by reducing the storage\n //\t\tpaths to a single mechanism.\n //\t3. Use the same single mechanism to support \"private\" and \"user\" data.\n //\t4. _Never_ expose \"private\" data to user code (TODO: Drop _data, _removeData)\n //\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n //\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\n var rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n rmultiDash = /[A-Z]/g;\n function getData(data) {\n if (data === \"true\") {\n return true;\n }\n if (data === \"false\") {\n return false;\n }\n if (data === \"null\") {\n return null;\n }\n\n // Only convert to a number if it doesn't change the string\n if (data === +data + \"\") {\n return +data;\n }\n if (rbrace.test(data)) {\n return JSON.parse(data);\n }\n return data;\n }\n function dataAttr(elem, key, data) {\n var name;\n\n // If nothing was found internally, try to fetch any\n // data from the HTML5 data-* attribute\n if (data === undefined && elem.nodeType === 1) {\n name = \"data-\" + key.replace(rmultiDash, \"-$&\").toLowerCase();\n data = elem.getAttribute(name);\n if (typeof data === \"string\") {\n try {\n data = getData(data);\n } catch (e) {}\n\n // Make sure we set the data so it isn't changed later\n dataUser.set(elem, key, data);\n } else {\n data = undefined;\n }\n }\n return data;\n }\n jQuery.extend({\n hasData: function (elem) {\n return dataUser.hasData(elem) || dataPriv.hasData(elem);\n },\n data: function (elem, name, data) {\n return dataUser.access(elem, name, data);\n },\n removeData: function (elem, name) {\n dataUser.remove(elem, name);\n },\n // TODO: Now that all calls to _data and _removeData have been replaced\n // with direct calls to dataPriv methods, these can be deprecated.\n _data: function (elem, name, data) {\n return dataPriv.access(elem, name, data);\n },\n _removeData: function (elem, name) {\n dataPriv.remove(elem, name);\n }\n });\n jQuery.fn.extend({\n data: function (key, value) {\n var i,\n name,\n data,\n elem = this[0],\n attrs = elem && elem.attributes;\n\n // Gets all values\n if (key === undefined) {\n if (this.length) {\n data = dataUser.get(elem);\n if (elem.nodeType === 1 && !dataPriv.get(elem, \"hasDataAttrs\")) {\n i = attrs.length;\n while (i--) {\n // Support: IE 11 only\n // The attrs elements can be null (trac-14894)\n if (attrs[i]) {\n name = attrs[i].name;\n if (name.indexOf(\"data-\") === 0) {\n name = camelCase(name.slice(5));\n dataAttr(elem, name, data[name]);\n }\n }\n }\n dataPriv.set(elem, \"hasDataAttrs\", true);\n }\n }\n return data;\n }\n\n // Sets multiple values\n if (typeof key === \"object\") {\n return this.each(function () {\n dataUser.set(this, key);\n });\n }\n return access(this, function (value) {\n var data;\n\n // The calling jQuery object (element matches) is not empty\n // (and therefore has an element appears at this[ 0 ]) and the\n // `value` parameter was not undefined. An empty jQuery object\n // will result in `undefined` for elem = this[ 0 ] which will\n // throw an exception if an attempt to read a data cache is made.\n if (elem && value === undefined) {\n // Attempt to get data from the cache\n // The key will always be camelCased in Data\n data = dataUser.get(elem, key);\n if (data !== undefined) {\n return data;\n }\n\n // Attempt to \"discover\" the data in\n // HTML5 custom data-* attrs\n data = dataAttr(elem, key);\n if (data !== undefined) {\n return data;\n }\n\n // We tried really hard, but the data doesn't exist.\n return;\n }\n\n // Set the data...\n this.each(function () {\n // We always store the camelCased key\n dataUser.set(this, key, value);\n });\n }, null, value, arguments.length > 1, null, true);\n },\n removeData: function (key) {\n return this.each(function () {\n dataUser.remove(this, key);\n });\n }\n });\n jQuery.extend({\n queue: function (elem, type, data) {\n var queue;\n if (elem) {\n type = (type || \"fx\") + \"queue\";\n queue = dataPriv.get(elem, type);\n\n // Speed up dequeue by getting out quickly if this is just a lookup\n if (data) {\n if (!queue || Array.isArray(data)) {\n queue = dataPriv.access(elem, type, jQuery.makeArray(data));\n } else {\n queue.push(data);\n }\n }\n return queue || [];\n }\n },\n dequeue: function (elem, type) {\n type = type || \"fx\";\n var queue = jQuery.queue(elem, type),\n startLength = queue.length,\n fn = queue.shift(),\n hooks = jQuery._queueHooks(elem, type),\n next = function () {\n jQuery.dequeue(elem, type);\n };\n\n // If the fx queue is dequeued, always remove the progress sentinel\n if (fn === \"inprogress\") {\n fn = queue.shift();\n startLength--;\n }\n if (fn) {\n // Add a progress sentinel to prevent the fx queue from being\n // automatically dequeued\n if (type === \"fx\") {\n queue.unshift(\"inprogress\");\n }\n\n // Clear up the last queue stop function\n delete hooks.stop;\n fn.call(elem, next, hooks);\n }\n if (!startLength && hooks) {\n hooks.empty.fire();\n }\n },\n // Not public - generate a queueHooks object, or return the current one\n _queueHooks: function (elem, type) {\n var key = type + \"queueHooks\";\n return dataPriv.get(elem, key) || dataPriv.access(elem, key, {\n empty: jQuery.Callbacks(\"once memory\").add(function () {\n dataPriv.remove(elem, [type + \"queue\", key]);\n })\n });\n }\n });\n jQuery.fn.extend({\n queue: function (type, data) {\n var setter = 2;\n if (typeof type !== \"string\") {\n data = type;\n type = \"fx\";\n setter--;\n }\n if (arguments.length < setter) {\n return jQuery.queue(this[0], type);\n }\n return data === undefined ? this : this.each(function () {\n var queue = jQuery.queue(this, type, data);\n\n // Ensure a hooks for this queue\n jQuery._queueHooks(this, type);\n if (type === \"fx\" && queue[0] !== \"inprogress\") {\n jQuery.dequeue(this, type);\n }\n });\n },\n dequeue: function (type) {\n return this.each(function () {\n jQuery.dequeue(this, type);\n });\n },\n clearQueue: function (type) {\n return this.queue(type || \"fx\", []);\n },\n // Get a promise resolved when queues of a certain type\n // are emptied (fx is the type by default)\n promise: function (type, obj) {\n var tmp,\n count = 1,\n defer = jQuery.Deferred(),\n elements = this,\n i = this.length,\n resolve = function () {\n if (! --count) {\n defer.resolveWith(elements, [elements]);\n }\n };\n if (typeof type !== \"string\") {\n obj = type;\n type = undefined;\n }\n type = type || \"fx\";\n while (i--) {\n tmp = dataPriv.get(elements[i], type + \"queueHooks\");\n if (tmp && tmp.empty) {\n count++;\n tmp.empty.add(resolve);\n }\n }\n resolve();\n return defer.promise(obj);\n }\n });\n var pnum = /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source;\n var rcssNum = new RegExp(\"^(?:([+-])=|)(\" + pnum + \")([a-z%]*)$\", \"i\");\n var cssExpand = [\"Top\", \"Right\", \"Bottom\", \"Left\"];\n var documentElement = document.documentElement;\n var isAttached = function (elem) {\n return jQuery.contains(elem.ownerDocument, elem);\n },\n composed = {\n composed: true\n };\n\n // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n // Check attachment across shadow DOM boundaries when possible (gh-3504)\n // Support: iOS 10.0-10.2 only\n // Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n // leading to errors. We need to check for `getRootNode`.\n if (documentElement.getRootNode) {\n isAttached = function (elem) {\n return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;\n };\n }\n var isHiddenWithinTree = function (elem, el) {\n // isHiddenWithinTree might be called from jQuery#filter function;\n // in that case, element will be second argument\n elem = el || elem;\n\n // Inline style trumps all\n return elem.style.display === \"none\" || elem.style.display === \"\" &&\n // Otherwise, check computed style\n // Support: Firefox <=43 - 45\n // Disconnected elements can have computed display: none, so first confirm that elem is\n // in the document.\n isAttached(elem) && jQuery.css(elem, \"display\") === \"none\";\n };\n function adjustCSS(elem, prop, valueParts, tween) {\n var adjusted,\n scale,\n maxIterations = 20,\n currentValue = tween ? function () {\n return tween.cur();\n } : function () {\n return jQuery.css(elem, prop, \"\");\n },\n initial = currentValue(),\n unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? \"\" : \"px\"),\n // Starting value computation is required for potential unit mismatches\n initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== \"px\" && +initial) && rcssNum.exec(jQuery.css(elem, prop));\n if (initialInUnit && initialInUnit[3] !== unit) {\n // Support: Firefox <=54\n // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n initial = initial / 2;\n\n // Trust units reported by jQuery.css\n unit = unit || initialInUnit[3];\n\n // Iteratively approximate from a nonzero starting point\n initialInUnit = +initial || 1;\n while (maxIterations--) {\n // Evaluate and update our best guess (doubling guesses that zero out).\n // Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n jQuery.style(elem, prop, initialInUnit + unit);\n if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {\n maxIterations = 0;\n }\n initialInUnit = initialInUnit / scale;\n }\n initialInUnit = initialInUnit * 2;\n jQuery.style(elem, prop, initialInUnit + unit);\n\n // Make sure we update the tween properties later on\n valueParts = valueParts || [];\n }\n if (valueParts) {\n initialInUnit = +initialInUnit || +initial || 0;\n\n // Apply relative offset (+=/-=) if specified\n adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];\n if (tween) {\n tween.unit = unit;\n tween.start = initialInUnit;\n tween.end = adjusted;\n }\n }\n return adjusted;\n }\n var defaultDisplayMap = {};\n function getDefaultDisplay(elem) {\n var temp,\n doc = elem.ownerDocument,\n nodeName = elem.nodeName,\n display = defaultDisplayMap[nodeName];\n if (display) {\n return display;\n }\n temp = doc.body.appendChild(doc.createElement(nodeName));\n display = jQuery.css(temp, \"display\");\n temp.parentNode.removeChild(temp);\n if (display === \"none\") {\n display = \"block\";\n }\n defaultDisplayMap[nodeName] = display;\n return display;\n }\n function showHide(elements, show) {\n var display,\n elem,\n values = [],\n index = 0,\n length = elements.length;\n\n // Determine new display value for elements that need to change\n for (; index < length; index++) {\n elem = elements[index];\n if (!elem.style) {\n continue;\n }\n display = elem.style.display;\n if (show) {\n // Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n // check is required in this first loop unless we have a nonempty display value (either\n // inline or about-to-be-restored)\n if (display === \"none\") {\n values[index] = dataPriv.get(elem, \"display\") || null;\n if (!values[index]) {\n elem.style.display = \"\";\n }\n }\n if (elem.style.display === \"\" && isHiddenWithinTree(elem)) {\n values[index] = getDefaultDisplay(elem);\n }\n } else {\n if (display !== \"none\") {\n values[index] = \"none\";\n\n // Remember what we're overwriting\n dataPriv.set(elem, \"display\", display);\n }\n }\n }\n\n // Set the display of the elements in a second loop to avoid constant reflow\n for (index = 0; index < length; index++) {\n if (values[index] != null) {\n elements[index].style.display = values[index];\n }\n }\n return elements;\n }\n jQuery.fn.extend({\n show: function () {\n return showHide(this, true);\n },\n hide: function () {\n return showHide(this);\n },\n toggle: function (state) {\n if (typeof state === \"boolean\") {\n return state ? this.show() : this.hide();\n }\n return this.each(function () {\n if (isHiddenWithinTree(this)) {\n jQuery(this).show();\n } else {\n jQuery(this).hide();\n }\n });\n }\n });\n var rcheckableType = /^(?:checkbox|radio)$/i;\n var rtagName = /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i;\n var rscriptType = /^$|^module$|\\/(?:java|ecma)script/i;\n (function () {\n var fragment = document.createDocumentFragment(),\n div = fragment.appendChild(document.createElement(\"div\")),\n input = document.createElement(\"input\");\n\n // Support: Android 4.0 - 4.3 only\n // Check state lost if the name is set (trac-11217)\n // Support: Windows Web Apps (WWA)\n // `name` and `type` must use .setAttribute for WWA (trac-14901)\n input.setAttribute(\"type\", \"radio\");\n input.setAttribute(\"checked\", \"checked\");\n input.setAttribute(\"name\", \"t\");\n div.appendChild(input);\n\n // Support: Android <=4.1 only\n // Older WebKit doesn't clone checked state correctly in fragments\n support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;\n\n // Support: IE <=11 only\n // Make sure textarea (and checkbox) defaultValue is properly cloned\n div.innerHTML = \"\";\n support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;\n\n // Support: IE <=9 only\n // IE <=9 replaces \";\n support.option = !!div.lastChild;\n })();\n\n // We have to close these tags to support XHTML (trac-13200)\n var wrapMap = {\n // XHTML parsers do not magically insert elements in the\n // same way that tag soup parsers do. So we cannot shorten\n // this by omitting or other required elements.\n thead: [1, \"\", \"
\"],\n col: [2, \"\", \"
\"],\n tr: [2, \"\", \"
\"],\n td: [3, \"\", \"
\"],\n _default: [0, \"\", \"\"]\n };\n wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n wrapMap.th = wrapMap.td;\n\n // Support: IE <=9 only\n if (!support.option) {\n wrapMap.optgroup = wrapMap.option = [1, \"\"];\n }\n function getAll(context, tag) {\n // Support: IE <=9 - 11 only\n // Use typeof to avoid zero-argument method invocation on host objects (trac-15151)\n var ret;\n if (typeof context.getElementsByTagName !== \"undefined\") {\n ret = context.getElementsByTagName(tag || \"*\");\n } else if (typeof context.querySelectorAll !== \"undefined\") {\n ret = context.querySelectorAll(tag || \"*\");\n } else {\n ret = [];\n }\n if (tag === undefined || tag && nodeName(context, tag)) {\n return jQuery.merge([context], ret);\n }\n return ret;\n }\n\n // Mark scripts as having already been evaluated\n function setGlobalEval(elems, refElements) {\n var i = 0,\n l = elems.length;\n for (; i < l; i++) {\n dataPriv.set(elems[i], \"globalEval\", !refElements || dataPriv.get(refElements[i], \"globalEval\"));\n }\n }\n var rhtml = /<|&#?\\w+;/;\n function buildFragment(elems, context, scripts, selection, ignored) {\n var elem,\n tmp,\n tag,\n wrap,\n attached,\n j,\n fragment = context.createDocumentFragment(),\n nodes = [],\n i = 0,\n l = elems.length;\n for (; i < l; i++) {\n elem = elems[i];\n if (elem || elem === 0) {\n // Add nodes directly\n if (toType(elem) === \"object\") {\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(nodes, elem.nodeType ? [elem] : elem);\n\n // Convert non-html into a text node\n } else if (!rhtml.test(elem)) {\n nodes.push(context.createTextNode(elem));\n\n // Convert html into DOM nodes\n } else {\n tmp = tmp || fragment.appendChild(context.createElement(\"div\"));\n\n // Deserialize a standard representation\n tag = (rtagName.exec(elem) || [\"\", \"\"])[1].toLowerCase();\n wrap = wrapMap[tag] || wrapMap._default;\n tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];\n\n // Descend through wrappers to the right content\n j = wrap[0];\n while (j--) {\n tmp = tmp.lastChild;\n }\n\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(nodes, tmp.childNodes);\n\n // Remember the top-level container\n tmp = fragment.firstChild;\n\n // Ensure the created nodes are orphaned (trac-12392)\n tmp.textContent = \"\";\n }\n }\n }\n\n // Remove wrapper from fragment\n fragment.textContent = \"\";\n i = 0;\n while (elem = nodes[i++]) {\n // Skip elements already in the context collection (trac-4087)\n if (selection && jQuery.inArray(elem, selection) > -1) {\n if (ignored) {\n ignored.push(elem);\n }\n continue;\n }\n attached = isAttached(elem);\n\n // Append to fragment\n tmp = getAll(fragment.appendChild(elem), \"script\");\n\n // Preserve script evaluation history\n if (attached) {\n setGlobalEval(tmp);\n }\n\n // Capture executables\n if (scripts) {\n j = 0;\n while (elem = tmp[j++]) {\n if (rscriptType.test(elem.type || \"\")) {\n scripts.push(elem);\n }\n }\n }\n }\n return fragment;\n }\n var rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n function returnTrue() {\n return true;\n }\n function returnFalse() {\n return false;\n }\n function on(elem, types, selector, data, fn, one) {\n var origFn, type;\n\n // Types can be a map of types/handlers\n if (typeof types === \"object\") {\n // ( types-Object, selector, data )\n if (typeof selector !== \"string\") {\n // ( types-Object, data )\n data = data || selector;\n selector = undefined;\n }\n for (type in types) {\n on(elem, type, selector, data, types[type], one);\n }\n return elem;\n }\n if (data == null && fn == null) {\n // ( types, fn )\n fn = selector;\n data = selector = undefined;\n } else if (fn == null) {\n if (typeof selector === \"string\") {\n // ( types, selector, fn )\n fn = data;\n data = undefined;\n } else {\n // ( types, data, fn )\n fn = data;\n data = selector;\n selector = undefined;\n }\n }\n if (fn === false) {\n fn = returnFalse;\n } else if (!fn) {\n return elem;\n }\n if (one === 1) {\n origFn = fn;\n fn = function (event) {\n // Can use an empty set, since event contains the info\n jQuery().off(event);\n return origFn.apply(this, arguments);\n };\n\n // Use same guid so caller can remove using origFn\n fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);\n }\n return elem.each(function () {\n jQuery.event.add(this, types, fn, data, selector);\n });\n }\n\n /*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards' addEvent library for many of the ideas.\n */\n jQuery.event = {\n global: {},\n add: function (elem, types, handler, data, selector) {\n var handleObjIn,\n eventHandle,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.get(elem);\n\n // Only attach events to objects that accept data\n if (!acceptData(elem)) {\n return;\n }\n\n // Caller can pass in an object of custom data in lieu of the handler\n if (handler.handler) {\n handleObjIn = handler;\n handler = handleObjIn.handler;\n selector = handleObjIn.selector;\n }\n\n // Ensure that invalid selectors throw exceptions at attach time\n // Evaluate against documentElement in case elem is a non-element node (e.g., document)\n if (selector) {\n jQuery.find.matchesSelector(documentElement, selector);\n }\n\n // Make sure that the handler has a unique ID, used to find/remove it later\n if (!handler.guid) {\n handler.guid = jQuery.guid++;\n }\n\n // Init the element's event structure and main handler, if this is the first\n if (!(events = elemData.events)) {\n events = elemData.events = Object.create(null);\n }\n if (!(eventHandle = elemData.handle)) {\n eventHandle = elemData.handle = function (e) {\n // Discard the second event of a jQuery.event.trigger() and\n // when an event is called after a page has unloaded\n return typeof jQuery !== \"undefined\" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined;\n };\n }\n\n // Handle multiple events separated by a space\n types = (types || \"\").match(rnothtmlwhite) || [\"\"];\n t = types.length;\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort();\n\n // There *must* be a type, no attaching namespace-only handlers\n if (!type) {\n continue;\n }\n\n // If event changes its type, use the special event handlers for the changed type\n special = jQuery.event.special[type] || {};\n\n // If selector defined, determine special event api type, otherwise given type\n type = (selector ? special.delegateType : special.bindType) || type;\n\n // Update special based on newly reset type\n special = jQuery.event.special[type] || {};\n\n // handleObj is passed to all event handlers\n handleObj = jQuery.extend({\n type: type,\n origType: origType,\n data: data,\n handler: handler,\n guid: handler.guid,\n selector: selector,\n needsContext: selector && jQuery.expr.match.needsContext.test(selector),\n namespace: namespaces.join(\".\")\n }, handleObjIn);\n\n // Init the event handler queue if we're the first\n if (!(handlers = events[type])) {\n handlers = events[type] = [];\n handlers.delegateCount = 0;\n\n // Only use addEventListener if the special events handler returns false\n if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {\n if (elem.addEventListener) {\n elem.addEventListener(type, eventHandle);\n }\n }\n }\n if (special.add) {\n special.add.call(elem, handleObj);\n if (!handleObj.handler.guid) {\n handleObj.handler.guid = handler.guid;\n }\n }\n\n // Add to the element's handler list, delegates in front\n if (selector) {\n handlers.splice(handlers.delegateCount++, 0, handleObj);\n } else {\n handlers.push(handleObj);\n }\n\n // Keep track of which events have ever been used, for event optimization\n jQuery.event.global[type] = true;\n }\n },\n // Detach an event or set of events from an element\n remove: function (elem, types, handler, selector, mappedTypes) {\n var j,\n origCount,\n tmp,\n events,\n t,\n handleObj,\n special,\n handlers,\n type,\n namespaces,\n origType,\n elemData = dataPriv.hasData(elem) && dataPriv.get(elem);\n if (!elemData || !(events = elemData.events)) {\n return;\n }\n\n // Once for each type.namespace in types; type may be omitted\n types = (types || \"\").match(rnothtmlwhite) || [\"\"];\n t = types.length;\n while (t--) {\n tmp = rtypenamespace.exec(types[t]) || [];\n type = origType = tmp[1];\n namespaces = (tmp[2] || \"\").split(\".\").sort();\n\n // Unbind all events (on this namespace, if provided) for the element\n if (!type) {\n for (type in events) {\n jQuery.event.remove(elem, type + types[t], handler, selector, true);\n }\n continue;\n }\n special = jQuery.event.special[type] || {};\n type = (selector ? special.delegateType : special.bindType) || type;\n handlers = events[type] || [];\n tmp = tmp[2] && new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\");\n\n // Remove matching events\n origCount = j = handlers.length;\n while (j--) {\n handleObj = handlers[j];\n if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector)) {\n handlers.splice(j, 1);\n if (handleObj.selector) {\n handlers.delegateCount--;\n }\n if (special.remove) {\n special.remove.call(elem, handleObj);\n }\n }\n }\n\n // Remove generic event handler if we removed something and no more handlers exist\n // (avoids potential for endless recursion during removal of special event handlers)\n if (origCount && !handlers.length) {\n if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {\n jQuery.removeEvent(elem, type, elemData.handle);\n }\n delete events[type];\n }\n }\n\n // Remove data and the expando if it's no longer used\n if (jQuery.isEmptyObject(events)) {\n dataPriv.remove(elem, \"handle events\");\n }\n },\n dispatch: function (nativeEvent) {\n var i,\n j,\n ret,\n matched,\n handleObj,\n handlerQueue,\n args = new Array(arguments.length),\n // Make a writable jQuery.Event from the native event object\n event = jQuery.event.fix(nativeEvent),\n handlers = (dataPriv.get(this, \"events\") || Object.create(null))[event.type] || [],\n special = jQuery.event.special[event.type] || {};\n\n // Use the fix-ed jQuery.Event rather than the (read-only) native event\n args[0] = event;\n for (i = 1; i < arguments.length; i++) {\n args[i] = arguments[i];\n }\n event.delegateTarget = this;\n\n // Call the preDispatch hook for the mapped type, and let it bail if desired\n if (special.preDispatch && special.preDispatch.call(this, event) === false) {\n return;\n }\n\n // Determine handlers\n handlerQueue = jQuery.event.handlers.call(this, event, handlers);\n\n // Run delegates first; they may want to stop propagation beneath us\n i = 0;\n while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {\n event.currentTarget = matched.elem;\n j = 0;\n while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {\n // If the event is namespaced, then each handler is only invoked if it is\n // specially universal or its namespaces are a superset of the event's.\n if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {\n event.handleObj = handleObj;\n event.data = handleObj.data;\n ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);\n if (ret !== undefined) {\n if ((event.result = ret) === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n }\n }\n\n // Call the postDispatch hook for the mapped type\n if (special.postDispatch) {\n special.postDispatch.call(this, event);\n }\n return event.result;\n },\n handlers: function (event, handlers) {\n var i,\n handleObj,\n sel,\n matchedHandlers,\n matchedSelectors,\n handlerQueue = [],\n delegateCount = handlers.delegateCount,\n cur = event.target;\n\n // Find delegate handlers\n if (delegateCount &&\n // Support: IE <=9\n // Black-hole SVG instance trees (trac-13180)\n cur.nodeType &&\n // Support: Firefox <=42\n // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n // Support: IE 11 only\n // ...but not arrow key \"clicks\" of radio inputs, which can have `button` -1 (gh-2343)\n !(event.type === \"click\" && event.button >= 1)) {\n for (; cur !== this; cur = cur.parentNode || this) {\n // Don't check non-elements (trac-13208)\n // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)\n if (cur.nodeType === 1 && !(event.type === \"click\" && cur.disabled === true)) {\n matchedHandlers = [];\n matchedSelectors = {};\n for (i = 0; i < delegateCount; i++) {\n handleObj = handlers[i];\n\n // Don't conflict with Object.prototype properties (trac-13203)\n sel = handleObj.selector + \" \";\n if (matchedSelectors[sel] === undefined) {\n matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;\n }\n if (matchedSelectors[sel]) {\n matchedHandlers.push(handleObj);\n }\n }\n if (matchedHandlers.length) {\n handlerQueue.push({\n elem: cur,\n handlers: matchedHandlers\n });\n }\n }\n }\n }\n\n // Add the remaining (directly-bound) handlers\n cur = this;\n if (delegateCount < handlers.length) {\n handlerQueue.push({\n elem: cur,\n handlers: handlers.slice(delegateCount)\n });\n }\n return handlerQueue;\n },\n addProp: function (name, hook) {\n Object.defineProperty(jQuery.Event.prototype, name, {\n enumerable: true,\n configurable: true,\n get: isFunction(hook) ? function () {\n if (this.originalEvent) {\n return hook(this.originalEvent);\n }\n } : function () {\n if (this.originalEvent) {\n return this.originalEvent[name];\n }\n },\n set: function (value) {\n Object.defineProperty(this, name, {\n enumerable: true,\n configurable: true,\n writable: true,\n value: value\n });\n }\n });\n },\n fix: function (originalEvent) {\n return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);\n },\n special: {\n load: {\n // Prevent triggered image.load events from bubbling to window.load\n noBubble: true\n },\n click: {\n // Utilize native event to ensure correct state for checkable inputs\n setup: function (data) {\n // For mutual compressibility with _default, replace `this` access with a local var.\n // `|| data` is dead code meant only to preserve the variable through minification.\n var el = this || data;\n\n // Claim the first handler\n if (rcheckableType.test(el.type) && el.click && nodeName(el, \"input\")) {\n // dataPriv.set( el, \"click\", ... )\n leverageNative(el, \"click\", true);\n }\n\n // Return false to allow normal processing in the caller\n return false;\n },\n trigger: function (data) {\n // For mutual compressibility with _default, replace `this` access with a local var.\n // `|| data` is dead code meant only to preserve the variable through minification.\n var el = this || data;\n\n // Force setup before triggering a click\n if (rcheckableType.test(el.type) && el.click && nodeName(el, \"input\")) {\n leverageNative(el, \"click\");\n }\n\n // Return non-false to allow normal event-path propagation\n return true;\n },\n // For cross-browser consistency, suppress native .click() on links\n // Also prevent it if we're currently inside a leveraged native-event stack\n _default: function (event) {\n var target = event.target;\n return rcheckableType.test(target.type) && target.click && nodeName(target, \"input\") && dataPriv.get(target, \"click\") || nodeName(target, \"a\");\n }\n },\n beforeunload: {\n postDispatch: function (event) {\n // Support: Firefox 20+\n // Firefox doesn't alert if the returnValue field is not set.\n if (event.result !== undefined && event.originalEvent) {\n event.originalEvent.returnValue = event.result;\n }\n }\n }\n }\n };\n\n // Ensure the presence of an event listener that handles manually-triggered\n // synthetic events by interrupting progress until reinvoked in response to\n // *native* events that it fires directly, ensuring that state changes have\n // already occurred before other listeners are invoked.\n function leverageNative(el, type, isSetup) {\n // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add\n if (!isSetup) {\n if (dataPriv.get(el, type) === undefined) {\n jQuery.event.add(el, type, returnTrue);\n }\n return;\n }\n\n // Register the controller as a special universal handler for all event namespaces\n dataPriv.set(el, type, false);\n jQuery.event.add(el, type, {\n namespace: false,\n handler: function (event) {\n var result,\n saved = dataPriv.get(this, type);\n if (event.isTrigger & 1 && this[type]) {\n // Interrupt processing of the outer synthetic .trigger()ed event\n if (!saved) {\n // Store arguments for use when handling the inner native event\n // There will always be at least one argument (an event object), so this array\n // will not be confused with a leftover capture object.\n saved = slice.call(arguments);\n dataPriv.set(this, type, saved);\n\n // Trigger the native event and capture its result\n this[type]();\n result = dataPriv.get(this, type);\n dataPriv.set(this, type, false);\n if (saved !== result) {\n // Cancel the outer synthetic event\n event.stopImmediatePropagation();\n event.preventDefault();\n return result;\n }\n\n // If this is an inner synthetic event for an event with a bubbling surrogate\n // (focus or blur), assume that the surrogate already propagated from triggering\n // the native event and prevent that from happening again here.\n // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n // bubbling surrogate propagates *after* the non-bubbling base), but that seems\n // less bad than duplication.\n } else if ((jQuery.event.special[type] || {}).delegateType) {\n event.stopPropagation();\n }\n\n // If this is a native event triggered above, everything is now in order\n // Fire an inner synthetic event with the original arguments\n } else if (saved) {\n // ...and capture the result\n dataPriv.set(this, type, jQuery.event.trigger(saved[0], saved.slice(1), this));\n\n // Abort handling of the native event by all jQuery handlers while allowing\n // native handlers on the same element to run. On target, this is achieved\n // by stopping immediate propagation just on the jQuery event. However,\n // the native event is re-wrapped by a jQuery one on each level of the\n // propagation so the only way to stop it for jQuery is to stop it for\n // everyone via native `stopPropagation()`. This is not a problem for\n // focus/blur which don't bubble, but it does also stop click on checkboxes\n // and radios. We accept this limitation.\n event.stopPropagation();\n event.isImmediatePropagationStopped = returnTrue;\n }\n }\n });\n }\n jQuery.removeEvent = function (elem, type, handle) {\n // This \"if\" is needed for plain objects\n if (elem.removeEventListener) {\n elem.removeEventListener(type, handle);\n }\n };\n jQuery.Event = function (src, props) {\n // Allow instantiation without the 'new' keyword\n if (!(this instanceof jQuery.Event)) {\n return new jQuery.Event(src, props);\n }\n\n // Event object\n if (src && src.type) {\n this.originalEvent = src;\n this.type = src.type;\n\n // Events bubbling up the document may have been marked as prevented\n // by a handler lower down the tree; reflect the correct value.\n this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined &&\n // Support: Android <=2.3 only\n src.returnValue === false ? returnTrue : returnFalse;\n\n // Create target properties\n // Support: Safari <=6 - 7 only\n // Target should not be a text node (trac-504, trac-13143)\n this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;\n this.currentTarget = src.currentTarget;\n this.relatedTarget = src.relatedTarget;\n\n // Event type\n } else {\n this.type = src;\n }\n\n // Put explicitly provided properties onto the event object\n if (props) {\n jQuery.extend(this, props);\n }\n\n // Create a timestamp if incoming event doesn't have one\n this.timeStamp = src && src.timeStamp || Date.now();\n\n // Mark it as fixed\n this[jQuery.expando] = true;\n };\n\n // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\n jQuery.Event.prototype = {\n constructor: jQuery.Event,\n isDefaultPrevented: returnFalse,\n isPropagationStopped: returnFalse,\n isImmediatePropagationStopped: returnFalse,\n isSimulated: false,\n preventDefault: function () {\n var e = this.originalEvent;\n this.isDefaultPrevented = returnTrue;\n if (e && !this.isSimulated) {\n e.preventDefault();\n }\n },\n stopPropagation: function () {\n var e = this.originalEvent;\n this.isPropagationStopped = returnTrue;\n if (e && !this.isSimulated) {\n e.stopPropagation();\n }\n },\n stopImmediatePropagation: function () {\n var e = this.originalEvent;\n this.isImmediatePropagationStopped = returnTrue;\n if (e && !this.isSimulated) {\n e.stopImmediatePropagation();\n }\n this.stopPropagation();\n }\n };\n\n // Includes all common event props including KeyEvent and MouseEvent specific props\n jQuery.each({\n altKey: true,\n bubbles: true,\n cancelable: true,\n changedTouches: true,\n ctrlKey: true,\n detail: true,\n eventPhase: true,\n metaKey: true,\n pageX: true,\n pageY: true,\n shiftKey: true,\n view: true,\n \"char\": true,\n code: true,\n charCode: true,\n key: true,\n keyCode: true,\n button: true,\n buttons: true,\n clientX: true,\n clientY: true,\n offsetX: true,\n offsetY: true,\n pointerId: true,\n pointerType: true,\n screenX: true,\n screenY: true,\n targetTouches: true,\n toElement: true,\n touches: true,\n which: true\n }, jQuery.event.addProp);\n jQuery.each({\n focus: \"focusin\",\n blur: \"focusout\"\n }, function (type, delegateType) {\n function focusMappedHandler(nativeEvent) {\n if (document.documentMode) {\n // Support: IE 11+\n // Attach a single focusin/focusout handler on the document while someone wants\n // focus/blur. This is because the former are synchronous in IE while the latter\n // are async. In other browsers, all those handlers are invoked synchronously.\n\n // `handle` from private data would already wrap the event, but we need\n // to change the `type` here.\n var handle = dataPriv.get(this, \"handle\"),\n event = jQuery.event.fix(nativeEvent);\n event.type = nativeEvent.type === \"focusin\" ? \"focus\" : \"blur\";\n event.isSimulated = true;\n\n // First, handle focusin/focusout\n handle(nativeEvent);\n\n // ...then, handle focus/blur\n //\n // focus/blur don't bubble while focusin/focusout do; simulate the former by only\n // invoking the handler at the lower level.\n if (event.target === event.currentTarget) {\n // The setup part calls `leverageNative`, which, in turn, calls\n // `jQuery.event.add`, so event handle will already have been set\n // by this point.\n handle(event);\n }\n } else {\n // For non-IE browsers, attach a single capturing handler on the document\n // while someone wants focusin/focusout.\n jQuery.event.simulate(delegateType, nativeEvent.target, jQuery.event.fix(nativeEvent));\n }\n }\n jQuery.event.special[type] = {\n // Utilize native event if possible so blur/focus sequence is correct\n setup: function () {\n var attaches;\n\n // Claim the first handler\n // dataPriv.set( this, \"focus\", ... )\n // dataPriv.set( this, \"blur\", ... )\n leverageNative(this, type, true);\n if (document.documentMode) {\n // Support: IE 9 - 11+\n // We use the same native handler for focusin & focus (and focusout & blur)\n // so we need to coordinate setup & teardown parts between those events.\n // Use `delegateType` as the key as `type` is already used by `leverageNative`.\n attaches = dataPriv.get(this, delegateType);\n if (!attaches) {\n this.addEventListener(delegateType, focusMappedHandler);\n }\n dataPriv.set(this, delegateType, (attaches || 0) + 1);\n } else {\n // Return false to allow normal processing in the caller\n return false;\n }\n },\n trigger: function () {\n // Force setup before trigger\n leverageNative(this, type);\n\n // Return non-false to allow normal event-path propagation\n return true;\n },\n teardown: function () {\n var attaches;\n if (document.documentMode) {\n attaches = dataPriv.get(this, delegateType) - 1;\n if (!attaches) {\n this.removeEventListener(delegateType, focusMappedHandler);\n dataPriv.remove(this, delegateType);\n } else {\n dataPriv.set(this, delegateType, attaches);\n }\n } else {\n // Return false to indicate standard teardown should be applied\n return false;\n }\n },\n // Suppress native focus or blur if we're currently inside\n // a leveraged native-event stack\n _default: function (event) {\n return dataPriv.get(event.target, type);\n },\n delegateType: delegateType\n };\n\n // Support: Firefox <=44\n // Firefox doesn't have focus(in | out) events\n // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n //\n // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n // focus(in | out) events fire after focus & blur events,\n // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\n //\n // Support: IE 9 - 11+\n // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch,\n // attach a single handler for both events in IE.\n jQuery.event.special[delegateType] = {\n setup: function () {\n // Handle: regular nodes (via `this.ownerDocument`), window\n // (via `this.document`) & document (via `this`).\n var doc = this.ownerDocument || this.document || this,\n dataHolder = document.documentMode ? this : doc,\n attaches = dataPriv.get(dataHolder, delegateType);\n\n // Support: IE 9 - 11+\n // We use the same native handler for focusin & focus (and focusout & blur)\n // so we need to coordinate setup & teardown parts between those events.\n // Use `delegateType` as the key as `type` is already used by `leverageNative`.\n if (!attaches) {\n if (document.documentMode) {\n this.addEventListener(delegateType, focusMappedHandler);\n } else {\n doc.addEventListener(type, focusMappedHandler, true);\n }\n }\n dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);\n },\n teardown: function () {\n var doc = this.ownerDocument || this.document || this,\n dataHolder = document.documentMode ? this : doc,\n attaches = dataPriv.get(dataHolder, delegateType) - 1;\n if (!attaches) {\n if (document.documentMode) {\n this.removeEventListener(delegateType, focusMappedHandler);\n } else {\n doc.removeEventListener(type, focusMappedHandler, true);\n }\n dataPriv.remove(dataHolder, delegateType);\n } else {\n dataPriv.set(dataHolder, delegateType, attaches);\n }\n }\n };\n });\n\n // Create mouseenter/leave events using mouseover/out and event-time checks\n // so that event delegation works in jQuery.\n // Do the same for pointerenter/pointerleave and pointerover/pointerout\n //\n // Support: Safari 7 only\n // Safari sends mouseenter too often; see:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n // for the description of the bug (it existed in older Chrome versions as well).\n jQuery.each({\n mouseenter: \"mouseover\",\n mouseleave: \"mouseout\",\n pointerenter: \"pointerover\",\n pointerleave: \"pointerout\"\n }, function (orig, fix) {\n jQuery.event.special[orig] = {\n delegateType: fix,\n bindType: fix,\n handle: function (event) {\n var ret,\n target = this,\n related = event.relatedTarget,\n handleObj = event.handleObj;\n\n // For mouseenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || related !== target && !jQuery.contains(target, related)) {\n event.type = handleObj.origType;\n ret = handleObj.handler.apply(this, arguments);\n event.type = fix;\n }\n return ret;\n }\n };\n });\n jQuery.fn.extend({\n on: function (types, selector, data, fn) {\n return on(this, types, selector, data, fn);\n },\n one: function (types, selector, data, fn) {\n return on(this, types, selector, data, fn, 1);\n },\n off: function (types, selector, fn) {\n var handleObj, type;\n if (types && types.preventDefault && types.handleObj) {\n // ( event ) dispatched jQuery.Event\n handleObj = types.handleObj;\n jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);\n return this;\n }\n if (typeof types === \"object\") {\n // ( types-object [, selector] )\n for (type in types) {\n this.off(type, selector, types[type]);\n }\n return this;\n }\n if (selector === false || typeof selector === \"function\") {\n // ( types [, fn] )\n fn = selector;\n selector = undefined;\n }\n if (fn === false) {\n fn = returnFalse;\n }\n return this.each(function () {\n jQuery.event.remove(this, types, fn, selector);\n });\n }\n });\n var\n // Support: IE <=10 - 11, Edge 12 - 13 only\n // In IE/Edge using regex groups here causes severe slowdowns.\n // See https://connect.microsoft.com/IE/feedback/details/1736512/\n rnoInnerhtml = /\\s*$/g;\n\n // Prefer a tbody over its parent table for containing new rows\n function manipulationTarget(elem, content) {\n if (nodeName(elem, \"table\") && nodeName(content.nodeType !== 11 ? content : content.firstChild, \"tr\")) {\n return jQuery(elem).children(\"tbody\")[0] || elem;\n }\n return elem;\n }\n\n // Replace/restore the type attribute of script elements for safe DOM manipulation\n function disableScript(elem) {\n elem.type = (elem.getAttribute(\"type\") !== null) + \"/\" + elem.type;\n return elem;\n }\n function restoreScript(elem) {\n if ((elem.type || \"\").slice(0, 5) === \"true/\") {\n elem.type = elem.type.slice(5);\n } else {\n elem.removeAttribute(\"type\");\n }\n return elem;\n }\n function cloneCopyEvent(src, dest) {\n var i, l, type, pdataOld, udataOld, udataCur, events;\n if (dest.nodeType !== 1) {\n return;\n }\n\n // 1. Copy private data: events, handlers, etc.\n if (dataPriv.hasData(src)) {\n pdataOld = dataPriv.get(src);\n events = pdataOld.events;\n if (events) {\n dataPriv.remove(dest, \"handle events\");\n for (type in events) {\n for (i = 0, l = events[type].length; i < l; i++) {\n jQuery.event.add(dest, type, events[type][i]);\n }\n }\n }\n }\n\n // 2. Copy user data\n if (dataUser.hasData(src)) {\n udataOld = dataUser.access(src);\n udataCur = jQuery.extend({}, udataOld);\n dataUser.set(dest, udataCur);\n }\n }\n\n // Fix IE bugs, see support tests\n function fixInput(src, dest) {\n var nodeName = dest.nodeName.toLowerCase();\n\n // Fails to persist the checked state of a cloned checkbox or radio button.\n if (nodeName === \"input\" && rcheckableType.test(src.type)) {\n dest.checked = src.checked;\n\n // Fails to return the selected option to the default selected state when cloning options\n } else if (nodeName === \"input\" || nodeName === \"textarea\") {\n dest.defaultValue = src.defaultValue;\n }\n }\n function domManip(collection, args, callback, ignored) {\n // Flatten any nested arrays\n args = flat(args);\n var fragment,\n first,\n scripts,\n hasScripts,\n node,\n doc,\n i = 0,\n l = collection.length,\n iNoClone = l - 1,\n value = args[0],\n valueIsFunction = isFunction(value);\n\n // We can't cloneNode fragments that contain checked, in WebKit\n if (valueIsFunction || l > 1 && typeof value === \"string\" && !support.checkClone && rchecked.test(value)) {\n return collection.each(function (index) {\n var self = collection.eq(index);\n if (valueIsFunction) {\n args[0] = value.call(this, index, self.html());\n }\n domManip(self, args, callback, ignored);\n });\n }\n if (l) {\n fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);\n first = fragment.firstChild;\n if (fragment.childNodes.length === 1) {\n fragment = first;\n }\n\n // Require either new content or an interest in ignored elements to invoke the callback\n if (first || ignored) {\n scripts = jQuery.map(getAll(fragment, \"script\"), disableScript);\n hasScripts = scripts.length;\n\n // Use the original fragment for the last item\n // instead of the first because it can end up\n // being emptied incorrectly in certain situations (trac-8070).\n for (; i < l; i++) {\n node = fragment;\n if (i !== iNoClone) {\n node = jQuery.clone(node, true, true);\n\n // Keep references to cloned scripts for later restoration\n if (hasScripts) {\n // Support: Android <=4.0 only, PhantomJS 1 only\n // push.apply(_, arraylike) throws on ancient WebKit\n jQuery.merge(scripts, getAll(node, \"script\"));\n }\n }\n callback.call(collection[i], node, i);\n }\n if (hasScripts) {\n doc = scripts[scripts.length - 1].ownerDocument;\n\n // Re-enable scripts\n jQuery.map(scripts, restoreScript);\n\n // Evaluate executable scripts on first document insertion\n for (i = 0; i < hasScripts; i++) {\n node = scripts[i];\n if (rscriptType.test(node.type || \"\") && !dataPriv.access(node, \"globalEval\") && jQuery.contains(doc, node)) {\n if (node.src && (node.type || \"\").toLowerCase() !== \"module\") {\n // Optional AJAX dependency, but won't run scripts if not present\n if (jQuery._evalUrl && !node.noModule) {\n jQuery._evalUrl(node.src, {\n nonce: node.nonce || node.getAttribute(\"nonce\")\n }, doc);\n }\n } else {\n // Unwrap a CDATA section containing script contents. This shouldn't be\n // needed as in XML documents they're already not visible when\n // inspecting element contents and in HTML documents they have no\n // meaning but we're preserving that logic for backwards compatibility.\n // This will be removed completely in 4.0. See gh-4904.\n DOMEval(node.textContent.replace(rcleanScript, \"\"), node, doc);\n }\n }\n }\n }\n }\n }\n return collection;\n }\n function remove(elem, selector, keepData) {\n var node,\n nodes = selector ? jQuery.filter(selector, elem) : elem,\n i = 0;\n for (; (node = nodes[i]) != null; i++) {\n if (!keepData && node.nodeType === 1) {\n jQuery.cleanData(getAll(node));\n }\n if (node.parentNode) {\n if (keepData && isAttached(node)) {\n setGlobalEval(getAll(node, \"script\"));\n }\n node.parentNode.removeChild(node);\n }\n }\n return elem;\n }\n jQuery.extend({\n htmlPrefilter: function (html) {\n return html;\n },\n clone: function (elem, dataAndEvents, deepDataAndEvents) {\n var i,\n l,\n srcElements,\n destElements,\n clone = elem.cloneNode(true),\n inPage = isAttached(elem);\n\n // Fix IE cloning issues\n if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {\n // We eschew jQuery#find here for performance reasons:\n // https://jsperf.com/getall-vs-sizzle/2\n destElements = getAll(clone);\n srcElements = getAll(elem);\n for (i = 0, l = srcElements.length; i < l; i++) {\n fixInput(srcElements[i], destElements[i]);\n }\n }\n\n // Copy the events from the original to the clone\n if (dataAndEvents) {\n if (deepDataAndEvents) {\n srcElements = srcElements || getAll(elem);\n destElements = destElements || getAll(clone);\n for (i = 0, l = srcElements.length; i < l; i++) {\n cloneCopyEvent(srcElements[i], destElements[i]);\n }\n } else {\n cloneCopyEvent(elem, clone);\n }\n }\n\n // Preserve script evaluation history\n destElements = getAll(clone, \"script\");\n if (destElements.length > 0) {\n setGlobalEval(destElements, !inPage && getAll(elem, \"script\"));\n }\n\n // Return the cloned set\n return clone;\n },\n cleanData: function (elems) {\n var data,\n elem,\n type,\n special = jQuery.event.special,\n i = 0;\n for (; (elem = elems[i]) !== undefined; i++) {\n if (acceptData(elem)) {\n if (data = elem[dataPriv.expando]) {\n if (data.events) {\n for (type in data.events) {\n if (special[type]) {\n jQuery.event.remove(elem, type);\n\n // This is a shortcut to avoid jQuery.event.remove's overhead\n } else {\n jQuery.removeEvent(elem, type, data.handle);\n }\n }\n }\n\n // Support: Chrome <=35 - 45+\n // Assign undefined instead of using delete, see Data#remove\n elem[dataPriv.expando] = undefined;\n }\n if (elem[dataUser.expando]) {\n // Support: Chrome <=35 - 45+\n // Assign undefined instead of using delete, see Data#remove\n elem[dataUser.expando] = undefined;\n }\n }\n }\n }\n });\n jQuery.fn.extend({\n detach: function (selector) {\n return remove(this, selector, true);\n },\n remove: function (selector) {\n return remove(this, selector);\n },\n text: function (value) {\n return access(this, function (value) {\n return value === undefined ? jQuery.text(this) : this.empty().each(function () {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n this.textContent = value;\n }\n });\n }, null, value, arguments.length);\n },\n append: function () {\n return domManip(this, arguments, function (elem) {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n var target = manipulationTarget(this, elem);\n target.appendChild(elem);\n }\n });\n },\n prepend: function () {\n return domManip(this, arguments, function (elem) {\n if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {\n var target = manipulationTarget(this, elem);\n target.insertBefore(elem, target.firstChild);\n }\n });\n },\n before: function () {\n return domManip(this, arguments, function (elem) {\n if (this.parentNode) {\n this.parentNode.insertBefore(elem, this);\n }\n });\n },\n after: function () {\n return domManip(this, arguments, function (elem) {\n if (this.parentNode) {\n this.parentNode.insertBefore(elem, this.nextSibling);\n }\n });\n },\n empty: function () {\n var elem,\n i = 0;\n for (; (elem = this[i]) != null; i++) {\n if (elem.nodeType === 1) {\n // Prevent memory leaks\n jQuery.cleanData(getAll(elem, false));\n\n // Remove any remaining nodes\n elem.textContent = \"\";\n }\n }\n return this;\n },\n clone: function (dataAndEvents, deepDataAndEvents) {\n dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n return this.map(function () {\n return jQuery.clone(this, dataAndEvents, deepDataAndEvents);\n });\n },\n html: function (value) {\n return access(this, function (value) {\n var elem = this[0] || {},\n i = 0,\n l = this.length;\n if (value === undefined && elem.nodeType === 1) {\n return elem.innerHTML;\n }\n\n // See if we can take a shortcut and just use innerHTML\n if (typeof value === \"string\" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || [\"\", \"\"])[1].toLowerCase()]) {\n value = jQuery.htmlPrefilter(value);\n try {\n for (; i < l; i++) {\n elem = this[i] || {};\n\n // Remove element nodes and prevent memory leaks\n if (elem.nodeType === 1) {\n jQuery.cleanData(getAll(elem, false));\n elem.innerHTML = value;\n }\n }\n elem = 0;\n\n // If using innerHTML throws an exception, use the fallback method\n } catch (e) {}\n }\n if (elem) {\n this.empty().append(value);\n }\n }, null, value, arguments.length);\n },\n replaceWith: function () {\n var ignored = [];\n\n // Make the changes, replacing each non-ignored context element with the new content\n return domManip(this, arguments, function (elem) {\n var parent = this.parentNode;\n if (jQuery.inArray(this, ignored) < 0) {\n jQuery.cleanData(getAll(this));\n if (parent) {\n parent.replaceChild(elem, this);\n }\n }\n\n // Force callback invocation\n }, ignored);\n }\n });\n jQuery.each({\n appendTo: \"append\",\n prependTo: \"prepend\",\n insertBefore: \"before\",\n insertAfter: \"after\",\n replaceAll: \"replaceWith\"\n }, function (name, original) {\n jQuery.fn[name] = function (selector) {\n var elems,\n ret = [],\n insert = jQuery(selector),\n last = insert.length - 1,\n i = 0;\n for (; i <= last; i++) {\n elems = i === last ? this : this.clone(true);\n jQuery(insert[i])[original](elems);\n\n // Support: Android <=4.0 only, PhantomJS 1 only\n // .get() because push.apply(_, arraylike) throws on ancient WebKit\n push.apply(ret, elems.get());\n }\n return this.pushStack(ret);\n };\n });\n var rnumnonpx = new RegExp(\"^(\" + pnum + \")(?!px)[a-z%]+$\", \"i\");\n var rcustomProp = /^--/;\n var getStyles = function (elem) {\n // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)\n // IE throws on elements created in popups\n // FF meanwhile throws on frame elements through \"defaultView.getComputedStyle\"\n var view = elem.ownerDocument.defaultView;\n if (!view || !view.opener) {\n view = window;\n }\n return view.getComputedStyle(elem);\n };\n var swap = function (elem, options, callback) {\n var ret,\n name,\n old = {};\n\n // Remember the old values, and insert the new ones\n for (name in options) {\n old[name] = elem.style[name];\n elem.style[name] = options[name];\n }\n ret = callback.call(elem);\n\n // Revert the old values\n for (name in options) {\n elem.style[name] = old[name];\n }\n return ret;\n };\n var rboxStyle = new RegExp(cssExpand.join(\"|\"), \"i\");\n (function () {\n // Executing both pixelPosition & boxSizingReliable tests require only one layout\n // so they're executed at the same time to save the second computation.\n function computeStyleTests() {\n // This is a singleton, we need to execute it only once\n if (!div) {\n return;\n }\n container.style.cssText = \"position:absolute;left:-11111px;width:60px;\" + \"margin-top:1px;padding:0;border:0\";\n div.style.cssText = \"position:relative;display:block;box-sizing:border-box;overflow:scroll;\" + \"margin:auto;border:1px;padding:1px;\" + \"width:60%;top:1%\";\n documentElement.appendChild(container).appendChild(div);\n var divStyle = window.getComputedStyle(div);\n pixelPositionVal = divStyle.top !== \"1%\";\n\n // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;\n\n // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n // Some styles come back with percentage values, even though they shouldn't\n div.style.right = \"60%\";\n pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;\n\n // Support: IE 9 - 11 only\n // Detect misreporting of content dimensions for box-sizing:border-box elements\n boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;\n\n // Support: IE 9 only\n // Detect overflow:scroll screwiness (gh-3699)\n // Support: Chrome <=64\n // Don't get tricked when zoom affects offsetWidth (gh-4029)\n div.style.position = \"absolute\";\n scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;\n documentElement.removeChild(container);\n\n // Nullify the div so it wouldn't be stored in the memory and\n // it will also be a sign that checks already performed\n div = null;\n }\n function roundPixelMeasures(measure) {\n return Math.round(parseFloat(measure));\n }\n var pixelPositionVal,\n boxSizingReliableVal,\n scrollboxSizeVal,\n pixelBoxStylesVal,\n reliableTrDimensionsVal,\n reliableMarginLeftVal,\n container = document.createElement(\"div\"),\n div = document.createElement(\"div\");\n\n // Finish early in limited (non-browser) environments\n if (!div.style) {\n return;\n }\n\n // Support: IE <=9 - 11 only\n // Style of cloned element affects source element cloned (trac-8908)\n div.style.backgroundClip = \"content-box\";\n div.cloneNode(true).style.backgroundClip = \"\";\n support.clearCloneStyle = div.style.backgroundClip === \"content-box\";\n jQuery.extend(support, {\n boxSizingReliable: function () {\n computeStyleTests();\n return boxSizingReliableVal;\n },\n pixelBoxStyles: function () {\n computeStyleTests();\n return pixelBoxStylesVal;\n },\n pixelPosition: function () {\n computeStyleTests();\n return pixelPositionVal;\n },\n reliableMarginLeft: function () {\n computeStyleTests();\n return reliableMarginLeftVal;\n },\n scrollboxSize: function () {\n computeStyleTests();\n return scrollboxSizeVal;\n },\n // Support: IE 9 - 11+, Edge 15 - 18+\n // IE/Edge misreport `getComputedStyle` of table rows with width/height\n // set in CSS while `offset*` properties report correct values.\n // Behavior in IE 9 is more subtle than in newer versions & it passes\n // some versions of this test; make sure not to make it pass there!\n //\n // Support: Firefox 70+\n // Only Firefox includes border widths\n // in computed dimensions. (gh-4529)\n reliableTrDimensions: function () {\n var table, tr, trChild, trStyle;\n if (reliableTrDimensionsVal == null) {\n table = document.createElement(\"table\");\n tr = document.createElement(\"tr\");\n trChild = document.createElement(\"div\");\n table.style.cssText = \"position:absolute;left:-11111px;border-collapse:separate\";\n tr.style.cssText = \"box-sizing:content-box;border:1px solid\";\n\n // Support: Chrome 86+\n // Height set through cssText does not get applied.\n // Computed height then comes back as 0.\n tr.style.height = \"1px\";\n trChild.style.height = \"9px\";\n\n // Support: Android 8 Chrome 86+\n // In our bodyBackground.html iframe,\n // display for all div elements is set to \"inline\",\n // which causes a problem only in Android 8 Chrome 86.\n // Ensuring the div is `display: block`\n // gets around this issue.\n trChild.style.display = \"block\";\n documentElement.appendChild(table).appendChild(tr).appendChild(trChild);\n trStyle = window.getComputedStyle(tr);\n reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;\n documentElement.removeChild(table);\n }\n return reliableTrDimensionsVal;\n }\n });\n })();\n function curCSS(elem, name, computed) {\n var width,\n minWidth,\n maxWidth,\n ret,\n isCustomProp = rcustomProp.test(name),\n // Support: Firefox 51+\n // Retrieving style before computed somehow\n // fixes an issue with getting wrong values\n // on detached elements\n style = elem.style;\n computed = computed || getStyles(elem);\n\n // getPropertyValue is needed for:\n // .css('filter') (IE 9 only, trac-12537)\n // .css('--customProperty) (gh-3144)\n if (computed) {\n // Support: IE <=9 - 11+\n // IE only supports `\"float\"` in `getPropertyValue`; in computed styles\n // it's only available as `\"cssFloat\"`. We no longer modify properties\n // sent to `.css()` apart from camelCasing, so we need to check both.\n // Normally, this would create difference in behavior: if\n // `getPropertyValue` returns an empty string, the value returned\n // by `.css()` would be `undefined`. This is usually the case for\n // disconnected elements. However, in IE even disconnected elements\n // with no styles return `\"none\"` for `getPropertyValue( \"float\" )`\n ret = computed.getPropertyValue(name) || computed[name];\n if (isCustomProp && ret) {\n // Support: Firefox 105+, Chrome <=105+\n // Spec requires trimming whitespace for custom properties (gh-4926).\n // Firefox only trims leading whitespace. Chrome just collapses\n // both leading & trailing whitespace to a single space.\n //\n // Fall back to `undefined` if empty string returned.\n // This collapses a missing definition with property defined\n // and set to an empty string but there's no standard API\n // allowing us to differentiate them without a performance penalty\n // and returning `undefined` aligns with older jQuery.\n //\n // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED\n // as whitespace while CSS does not, but this is not a problem\n // because CSS preprocessing replaces them with U+000A LINE FEED\n // (which *is* CSS whitespace)\n // https://www.w3.org/TR/css-syntax-3/#input-preprocessing\n ret = ret.replace(rtrimCSS, \"$1\") || undefined;\n }\n if (ret === \"\" && !isAttached(elem)) {\n ret = jQuery.style(elem, name);\n }\n\n // A tribute to the \"awesome hack by Dean Edwards\"\n // Android Browser returns percentage for some values,\n // but width seems to be reliably pixels.\n // This is against the CSSOM draft spec:\n // https://drafts.csswg.org/cssom/#resolved-values\n if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {\n // Remember the original values\n width = style.width;\n minWidth = style.minWidth;\n maxWidth = style.maxWidth;\n\n // Put in the new values to get a computed value out\n style.minWidth = style.maxWidth = style.width = ret;\n ret = computed.width;\n\n // Revert the changed values\n style.width = width;\n style.minWidth = minWidth;\n style.maxWidth = maxWidth;\n }\n }\n return ret !== undefined ?\n // Support: IE <=9 - 11 only\n // IE returns zIndex value as an integer.\n ret + \"\" : ret;\n }\n function addGetHookIf(conditionFn, hookFn) {\n // Define the hook, we'll check on the first run if it's really needed.\n return {\n get: function () {\n if (conditionFn()) {\n // Hook not needed (or it's not possible to use it due\n // to missing dependency), remove it.\n delete this.get;\n return;\n }\n\n // Hook needed; redefine it so that the support test is not executed again.\n return (this.get = hookFn).apply(this, arguments);\n }\n };\n }\n var cssPrefixes = [\"Webkit\", \"Moz\", \"ms\"],\n emptyStyle = document.createElement(\"div\").style,\n vendorProps = {};\n\n // Return a vendor-prefixed property or undefined\n function vendorPropName(name) {\n // Check for vendor prefixed names\n var capName = name[0].toUpperCase() + name.slice(1),\n i = cssPrefixes.length;\n while (i--) {\n name = cssPrefixes[i] + capName;\n if (name in emptyStyle) {\n return name;\n }\n }\n }\n\n // Return a potentially-mapped jQuery.cssProps or vendor prefixed property\n function finalPropName(name) {\n var final = jQuery.cssProps[name] || vendorProps[name];\n if (final) {\n return final;\n }\n if (name in emptyStyle) {\n return name;\n }\n return vendorProps[name] = vendorPropName(name) || name;\n }\n var\n // Swappable if display is none or starts with table\n // except \"table\", \"table-cell\", or \"table-caption\"\n // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n rdisplayswap = /^(none|table(?!-c[ea]).+)/,\n cssShow = {\n position: \"absolute\",\n visibility: \"hidden\",\n display: \"block\"\n },\n cssNormalTransform = {\n letterSpacing: \"0\",\n fontWeight: \"400\"\n };\n function setPositiveNumber(_elem, value, subtract) {\n // Any relative (+/-) values have already been\n // normalized at this point\n var matches = rcssNum.exec(value);\n return matches ?\n // Guard against undefined \"subtract\", e.g., when used as in cssHooks\n Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || \"px\") : value;\n }\n function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {\n var i = dimension === \"width\" ? 1 : 0,\n extra = 0,\n delta = 0,\n marginDelta = 0;\n\n // Adjustment may not be necessary\n if (box === (isBorderBox ? \"border\" : \"content\")) {\n return 0;\n }\n for (; i < 4; i += 2) {\n // Both box models exclude margin\n // Count margin delta separately to only add it after scroll gutter adjustment.\n // This is needed to make negative margins work with `outerHeight( true )` (gh-3982).\n if (box === \"margin\") {\n marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles);\n }\n\n // If we get here with a content-box, we're seeking \"padding\" or \"border\" or \"margin\"\n if (!isBorderBox) {\n // Add padding\n delta += jQuery.css(elem, \"padding\" + cssExpand[i], true, styles);\n\n // For \"border\" or \"margin\", add border\n if (box !== \"padding\") {\n delta += jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles);\n\n // But still keep track of it otherwise\n } else {\n extra += jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles);\n }\n\n // If we get here with a border-box (content + padding + border), we're seeking \"content\" or\n // \"padding\" or \"margin\"\n } else {\n // For \"content\", subtract padding\n if (box === \"content\") {\n delta -= jQuery.css(elem, \"padding\" + cssExpand[i], true, styles);\n }\n\n // For \"content\" or \"padding\", subtract border\n if (box !== \"margin\") {\n delta -= jQuery.css(elem, \"border\" + cssExpand[i] + \"Width\", true, styles);\n }\n }\n }\n\n // Account for positive content-box scroll gutter when requested by providing computedVal\n if (!isBorderBox && computedVal >= 0) {\n // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n // Assuming integer scroll gutter, subtract the rest and round down\n delta += Math.max(0, Math.ceil(elem[\"offset\" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5\n\n // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\n // Use an explicit zero to avoid NaN (gh-3964)\n )) || 0;\n }\n return delta + marginDelta;\n }\n function getWidthOrHeight(elem, dimension, extra) {\n // Start with computed style\n var styles = getStyles(elem),\n // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n // Fake content-box until we know it's needed to know the true value.\n boxSizingNeeded = !support.boxSizingReliable() || extra,\n isBorderBox = boxSizingNeeded && jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\",\n valueIsBorderBox = isBorderBox,\n val = curCSS(elem, dimension, styles),\n offsetProp = \"offset\" + dimension[0].toUpperCase() + dimension.slice(1);\n\n // Support: Firefox <=54\n // Return a confounding non-pixel value or feign ignorance, as appropriate.\n if (rnumnonpx.test(val)) {\n if (!extra) {\n return val;\n }\n val = \"auto\";\n }\n\n // Support: IE 9 - 11 only\n // Use offsetWidth/offsetHeight for when box sizing is unreliable.\n // In those cases, the computed value can be trusted to be border-box.\n if ((!support.boxSizingReliable() && isBorderBox ||\n // Support: IE 10 - 11+, Edge 15 - 18+\n // IE/Edge misreport `getComputedStyle` of table rows with width/height\n // set in CSS while `offset*` properties report correct values.\n // Interestingly, in some cases IE 9 doesn't suffer from this issue.\n !support.reliableTrDimensions() && nodeName(elem, \"tr\") ||\n // Fall back to offsetWidth/offsetHeight when value is \"auto\"\n // This happens for inline elements with no explicit setting (gh-3571)\n val === \"auto\" ||\n // Support: Android <=4.1 - 4.3 only\n // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n !parseFloat(val) && jQuery.css(elem, \"display\", false, styles) === \"inline\") &&\n // Make sure the element is visible & connected\n elem.getClientRects().length) {\n isBorderBox = jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\";\n\n // Where available, offsetWidth/offsetHeight approximate border box dimensions.\n // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n // retrieved value as a content box dimension.\n valueIsBorderBox = offsetProp in elem;\n if (valueIsBorderBox) {\n val = elem[offsetProp];\n }\n }\n\n // Normalize \"\" and auto\n val = parseFloat(val) || 0;\n\n // Adjust for the element's box model\n return val + boxModelAdjustment(elem, dimension, extra || (isBorderBox ? \"border\" : \"content\"), valueIsBorderBox, styles,\n // Provide the current computed size to request scroll gutter calculation (gh-3589)\n val) + \"px\";\n }\n jQuery.extend({\n // Add in style property hooks for overriding the default\n // behavior of getting and setting a style property\n cssHooks: {\n opacity: {\n get: function (elem, computed) {\n if (computed) {\n // We should always get a number back from opacity\n var ret = curCSS(elem, \"opacity\");\n return ret === \"\" ? \"1\" : ret;\n }\n }\n }\n },\n // Don't automatically add \"px\" to these possibly-unitless properties\n cssNumber: {\n animationIterationCount: true,\n aspectRatio: true,\n borderImageSlice: true,\n columnCount: true,\n flexGrow: true,\n flexShrink: true,\n fontWeight: true,\n gridArea: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnStart: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowStart: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n scale: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeMiterlimit: true,\n strokeOpacity: true\n },\n // Add in properties whose names you wish to fix before\n // setting or getting the value\n cssProps: {},\n // Get and set the style property on a DOM Node\n style: function (elem, name, value, extra) {\n // Don't set styles on text and comment nodes\n if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {\n return;\n }\n\n // Make sure that we're working with the right name\n var ret,\n type,\n hooks,\n origName = camelCase(name),\n isCustomProp = rcustomProp.test(name),\n style = elem.style;\n\n // Make sure that we're working with the right name. We don't\n // want to query the value if it is a CSS custom property\n // since they are user-defined.\n if (!isCustomProp) {\n name = finalPropName(origName);\n }\n\n // Gets hook for the prefixed version, then unprefixed version\n hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];\n\n // Check if we're setting a value\n if (value !== undefined) {\n type = typeof value;\n\n // Convert \"+=\" or \"-=\" to relative numbers (trac-7345)\n if (type === \"string\" && (ret = rcssNum.exec(value)) && ret[1]) {\n value = adjustCSS(elem, name, ret);\n\n // Fixes bug trac-9237\n type = \"number\";\n }\n\n // Make sure that null and NaN values aren't set (trac-7116)\n if (value == null || value !== value) {\n return;\n }\n\n // If a number was passed in, add the unit (except for certain CSS properties)\n // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n // \"px\" to a few hardcoded values.\n if (type === \"number\" && !isCustomProp) {\n value += ret && ret[3] || (jQuery.cssNumber[origName] ? \"\" : \"px\");\n }\n\n // background-* props affect original clone's values\n if (!support.clearCloneStyle && value === \"\" && name.indexOf(\"background\") === 0) {\n style[name] = \"inherit\";\n }\n\n // If a hook was provided, use that value, otherwise just set the specified value\n if (!hooks || !(\"set\" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {\n if (isCustomProp) {\n style.setProperty(name, value);\n } else {\n style[name] = value;\n }\n }\n } else {\n // If a hook was provided get the non-computed value from there\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {\n return ret;\n }\n\n // Otherwise just get the value from the style object\n return style[name];\n }\n },\n css: function (elem, name, extra, styles) {\n var val,\n num,\n hooks,\n origName = camelCase(name),\n isCustomProp = rcustomProp.test(name);\n\n // Make sure that we're working with the right name. We don't\n // want to modify the value if it is a CSS custom property\n // since they are user-defined.\n if (!isCustomProp) {\n name = finalPropName(origName);\n }\n\n // Try prefixed name followed by the unprefixed name\n hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];\n\n // If a hook was provided get the computed value from there\n if (hooks && \"get\" in hooks) {\n val = hooks.get(elem, true, extra);\n }\n\n // Otherwise, if a way to get the computed value exists, use that\n if (val === undefined) {\n val = curCSS(elem, name, styles);\n }\n\n // Convert \"normal\" to computed value\n if (val === \"normal\" && name in cssNormalTransform) {\n val = cssNormalTransform[name];\n }\n\n // Make numeric if forced or a qualifier was provided and val looks numeric\n if (extra === \"\" || extra) {\n num = parseFloat(val);\n return extra === true || isFinite(num) ? num || 0 : val;\n }\n return val;\n }\n });\n jQuery.each([\"height\", \"width\"], function (_i, dimension) {\n jQuery.cssHooks[dimension] = {\n get: function (elem, computed, extra) {\n if (computed) {\n // Certain elements can have dimension info if we invisibly show them\n // but it must have a current display style that would benefit\n return rdisplayswap.test(jQuery.css(elem, \"display\")) && (\n // Support: Safari 8+\n // Table columns in Safari have non-zero offsetWidth & zero\n // getBoundingClientRect().width unless display is changed.\n // Support: IE <=11 only\n // Running getBoundingClientRect on a disconnected node\n // in IE throws an error.\n !elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function () {\n return getWidthOrHeight(elem, dimension, extra);\n }) : getWidthOrHeight(elem, dimension, extra);\n }\n },\n set: function (elem, value, extra) {\n var matches,\n styles = getStyles(elem),\n // Only read styles.position if the test has a chance to fail\n // to avoid forcing a reflow.\n scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === \"absolute\",\n // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n boxSizingNeeded = scrollboxSizeBuggy || extra,\n isBorderBox = boxSizingNeeded && jQuery.css(elem, \"boxSizing\", false, styles) === \"border-box\",\n subtract = extra ? boxModelAdjustment(elem, dimension, extra, isBorderBox, styles) : 0;\n\n // Account for unreliable border-box dimensions by comparing offset* to computed and\n // faking a content-box to get border and padding (gh-3699)\n if (isBorderBox && scrollboxSizeBuggy) {\n subtract -= Math.ceil(elem[\"offset\" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, \"border\", false, styles) - 0.5);\n }\n\n // Convert to pixels if value adjustment is needed\n if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || \"px\") !== \"px\") {\n elem.style[dimension] = value;\n value = jQuery.css(elem, dimension);\n }\n return setPositiveNumber(elem, value, subtract);\n }\n };\n });\n jQuery.cssHooks.marginLeft = addGetHookIf(support.reliableMarginLeft, function (elem, computed) {\n if (computed) {\n return (parseFloat(curCSS(elem, \"marginLeft\")) || elem.getBoundingClientRect().left - swap(elem, {\n marginLeft: 0\n }, function () {\n return elem.getBoundingClientRect().left;\n })) + \"px\";\n }\n });\n\n // These hooks are used by animate to expand properties\n jQuery.each({\n margin: \"\",\n padding: \"\",\n border: \"Width\"\n }, function (prefix, suffix) {\n jQuery.cssHooks[prefix + suffix] = {\n expand: function (value) {\n var i = 0,\n expanded = {},\n // Assumes a single number if not a string\n parts = typeof value === \"string\" ? value.split(\" \") : [value];\n for (; i < 4; i++) {\n expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];\n }\n return expanded;\n }\n };\n if (prefix !== \"margin\") {\n jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;\n }\n });\n jQuery.fn.extend({\n css: function (name, value) {\n return access(this, function (elem, name, value) {\n var styles,\n len,\n map = {},\n i = 0;\n if (Array.isArray(name)) {\n styles = getStyles(elem);\n len = name.length;\n for (; i < len; i++) {\n map[name[i]] = jQuery.css(elem, name[i], false, styles);\n }\n return map;\n }\n return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name);\n }, name, value, arguments.length > 1);\n }\n });\n function Tween(elem, options, prop, end, easing) {\n return new Tween.prototype.init(elem, options, prop, end, easing);\n }\n jQuery.Tween = Tween;\n Tween.prototype = {\n constructor: Tween,\n init: function (elem, options, prop, end, easing, unit) {\n this.elem = elem;\n this.prop = prop;\n this.easing = easing || jQuery.easing._default;\n this.options = options;\n this.start = this.now = this.cur();\n this.end = end;\n this.unit = unit || (jQuery.cssNumber[prop] ? \"\" : \"px\");\n },\n cur: function () {\n var hooks = Tween.propHooks[this.prop];\n return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);\n },\n run: function (percent) {\n var eased,\n hooks = Tween.propHooks[this.prop];\n if (this.options.duration) {\n this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration);\n } else {\n this.pos = eased = percent;\n }\n this.now = (this.end - this.start) * eased + this.start;\n if (this.options.step) {\n this.options.step.call(this.elem, this.now, this);\n }\n if (hooks && hooks.set) {\n hooks.set(this);\n } else {\n Tween.propHooks._default.set(this);\n }\n return this;\n }\n };\n Tween.prototype.init.prototype = Tween.prototype;\n Tween.propHooks = {\n _default: {\n get: function (tween) {\n var result;\n\n // Use a property on the element directly when it is not a DOM element,\n // or when there is no matching style property that exists.\n if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {\n return tween.elem[tween.prop];\n }\n\n // Passing an empty string as a 3rd parameter to .css will automatically\n // attempt a parseFloat and fallback to a string if the parse fails.\n // Simple values such as \"10px\" are parsed to Float;\n // complex values such as \"rotate(1rad)\" are returned as-is.\n result = jQuery.css(tween.elem, tween.prop, \"\");\n\n // Empty strings, null, undefined and \"auto\" are converted to 0.\n return !result || result === \"auto\" ? 0 : result;\n },\n set: function (tween) {\n // Use step hook for back compat.\n // Use cssHook if its there.\n // Use .style if available and use plain properties where available.\n if (jQuery.fx.step[tween.prop]) {\n jQuery.fx.step[tween.prop](tween);\n } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {\n jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);\n } else {\n tween.elem[tween.prop] = tween.now;\n }\n }\n }\n };\n\n // Support: IE <=9 only\n // Panic based approach to setting things on disconnected nodes\n Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n set: function (tween) {\n if (tween.elem.nodeType && tween.elem.parentNode) {\n tween.elem[tween.prop] = tween.now;\n }\n }\n };\n jQuery.easing = {\n linear: function (p) {\n return p;\n },\n swing: function (p) {\n return 0.5 - Math.cos(p * Math.PI) / 2;\n },\n _default: \"swing\"\n };\n jQuery.fx = Tween.prototype.init;\n\n // Back compat <1.8 extension point\n jQuery.fx.step = {};\n var fxNow,\n inProgress,\n rfxtypes = /^(?:toggle|show|hide)$/,\n rrun = /queueHooks$/;\n function schedule() {\n if (inProgress) {\n if (document.hidden === false && window.requestAnimationFrame) {\n window.requestAnimationFrame(schedule);\n } else {\n window.setTimeout(schedule, jQuery.fx.interval);\n }\n jQuery.fx.tick();\n }\n }\n\n // Animations created synchronously will run synchronously\n function createFxNow() {\n window.setTimeout(function () {\n fxNow = undefined;\n });\n return fxNow = Date.now();\n }\n\n // Generate parameters to create a standard animation\n function genFx(type, includeWidth) {\n var which,\n i = 0,\n attrs = {\n height: type\n };\n\n // If we include width, step value is 1 to do all cssExpand values,\n // otherwise step value is 2 to skip over Left and Right\n includeWidth = includeWidth ? 1 : 0;\n for (; i < 4; i += 2 - includeWidth) {\n which = cssExpand[i];\n attrs[\"margin\" + which] = attrs[\"padding\" + which] = type;\n }\n if (includeWidth) {\n attrs.opacity = attrs.width = type;\n }\n return attrs;\n }\n function createTween(value, prop, animation) {\n var tween,\n collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners[\"*\"]),\n index = 0,\n length = collection.length;\n for (; index < length; index++) {\n if (tween = collection[index].call(animation, prop, value)) {\n // We're done with this property\n return tween;\n }\n }\n }\n function defaultPrefilter(elem, props, opts) {\n var prop,\n value,\n toggle,\n hooks,\n oldfire,\n propTween,\n restoreDisplay,\n display,\n isBox = \"width\" in props || \"height\" in props,\n anim = this,\n orig = {},\n style = elem.style,\n hidden = elem.nodeType && isHiddenWithinTree(elem),\n dataShow = dataPriv.get(elem, \"fxshow\");\n\n // Queue-skipping animations hijack the fx hooks\n if (!opts.queue) {\n hooks = jQuery._queueHooks(elem, \"fx\");\n if (hooks.unqueued == null) {\n hooks.unqueued = 0;\n oldfire = hooks.empty.fire;\n hooks.empty.fire = function () {\n if (!hooks.unqueued) {\n oldfire();\n }\n };\n }\n hooks.unqueued++;\n anim.always(function () {\n // Ensure the complete handler is called before this completes\n anim.always(function () {\n hooks.unqueued--;\n if (!jQuery.queue(elem, \"fx\").length) {\n hooks.empty.fire();\n }\n });\n });\n }\n\n // Detect show/hide animations\n for (prop in props) {\n value = props[prop];\n if (rfxtypes.test(value)) {\n delete props[prop];\n toggle = toggle || value === \"toggle\";\n if (value === (hidden ? \"hide\" : \"show\")) {\n // Pretend to be hidden if this is a \"show\" and\n // there is still data from a stopped show/hide\n if (value === \"show\" && dataShow && dataShow[prop] !== undefined) {\n hidden = true;\n\n // Ignore all other no-op show/hide data\n } else {\n continue;\n }\n }\n orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);\n }\n }\n\n // Bail out if this is a no-op like .hide().hide()\n propTween = !jQuery.isEmptyObject(props);\n if (!propTween && jQuery.isEmptyObject(orig)) {\n return;\n }\n\n // Restrict \"overflow\" and \"display\" styles during box animations\n if (isBox && elem.nodeType === 1) {\n // Support: IE <=9 - 11, Edge 12 - 15\n // Record all 3 overflow attributes because IE does not infer the shorthand\n // from identically-valued overflowX and overflowY and Edge just mirrors\n // the overflowX value there.\n opts.overflow = [style.overflow, style.overflowX, style.overflowY];\n\n // Identify a display type, preferring old show/hide data over the CSS cascade\n restoreDisplay = dataShow && dataShow.display;\n if (restoreDisplay == null) {\n restoreDisplay = dataPriv.get(elem, \"display\");\n }\n display = jQuery.css(elem, \"display\");\n if (display === \"none\") {\n if (restoreDisplay) {\n display = restoreDisplay;\n } else {\n // Get nonempty value(s) by temporarily forcing visibility\n showHide([elem], true);\n restoreDisplay = elem.style.display || restoreDisplay;\n display = jQuery.css(elem, \"display\");\n showHide([elem]);\n }\n }\n\n // Animate inline elements as inline-block\n if (display === \"inline\" || display === \"inline-block\" && restoreDisplay != null) {\n if (jQuery.css(elem, \"float\") === \"none\") {\n // Restore the original display value at the end of pure show/hide animations\n if (!propTween) {\n anim.done(function () {\n style.display = restoreDisplay;\n });\n if (restoreDisplay == null) {\n display = style.display;\n restoreDisplay = display === \"none\" ? \"\" : display;\n }\n }\n style.display = \"inline-block\";\n }\n }\n }\n if (opts.overflow) {\n style.overflow = \"hidden\";\n anim.always(function () {\n style.overflow = opts.overflow[0];\n style.overflowX = opts.overflow[1];\n style.overflowY = opts.overflow[2];\n });\n }\n\n // Implement show/hide animations\n propTween = false;\n for (prop in orig) {\n // General show/hide setup for this element animation\n if (!propTween) {\n if (dataShow) {\n if (\"hidden\" in dataShow) {\n hidden = dataShow.hidden;\n }\n } else {\n dataShow = dataPriv.access(elem, \"fxshow\", {\n display: restoreDisplay\n });\n }\n\n // Store hidden/visible for toggle so `.stop().toggle()` \"reverses\"\n if (toggle) {\n dataShow.hidden = !hidden;\n }\n\n // Show elements before animating them\n if (hidden) {\n showHide([elem], true);\n }\n\n /* eslint-disable no-loop-func */\n\n anim.done(function () {\n /* eslint-enable no-loop-func */\n\n // The final step of a \"hide\" animation is actually hiding the element\n if (!hidden) {\n showHide([elem]);\n }\n dataPriv.remove(elem, \"fxshow\");\n for (prop in orig) {\n jQuery.style(elem, prop, orig[prop]);\n }\n });\n }\n\n // Per-property setup\n propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);\n if (!(prop in dataShow)) {\n dataShow[prop] = propTween.start;\n if (hidden) {\n propTween.end = propTween.start;\n propTween.start = 0;\n }\n }\n }\n }\n function propFilter(props, specialEasing) {\n var index, name, easing, value, hooks;\n\n // camelCase, specialEasing and expand cssHook pass\n for (index in props) {\n name = camelCase(index);\n easing = specialEasing[name];\n value = props[index];\n if (Array.isArray(value)) {\n easing = value[1];\n value = props[index] = value[0];\n }\n if (index !== name) {\n props[name] = value;\n delete props[index];\n }\n hooks = jQuery.cssHooks[name];\n if (hooks && \"expand\" in hooks) {\n value = hooks.expand(value);\n delete props[name];\n\n // Not quite $.extend, this won't overwrite existing keys.\n // Reusing 'index' because we have the correct \"name\"\n for (index in value) {\n if (!(index in props)) {\n props[index] = value[index];\n specialEasing[index] = easing;\n }\n }\n } else {\n specialEasing[name] = easing;\n }\n }\n }\n function Animation(elem, properties, options) {\n var result,\n stopped,\n index = 0,\n length = Animation.prefilters.length,\n deferred = jQuery.Deferred().always(function () {\n // Don't match elem in the :animated selector\n delete tick.elem;\n }),\n tick = function () {\n if (stopped) {\n return false;\n }\n var currentTime = fxNow || createFxNow(),\n remaining = Math.max(0, animation.startTime + animation.duration - currentTime),\n // Support: Android 2.3 only\n // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497)\n temp = remaining / animation.duration || 0,\n percent = 1 - temp,\n index = 0,\n length = animation.tweens.length;\n for (; index < length; index++) {\n animation.tweens[index].run(percent);\n }\n deferred.notifyWith(elem, [animation, percent, remaining]);\n\n // If there's more to do, yield\n if (percent < 1 && length) {\n return remaining;\n }\n\n // If this was an empty animation, synthesize a final progress notification\n if (!length) {\n deferred.notifyWith(elem, [animation, 1, 0]);\n }\n\n // Resolve the animation and report its conclusion\n deferred.resolveWith(elem, [animation]);\n return false;\n },\n animation = deferred.promise({\n elem: elem,\n props: jQuery.extend({}, properties),\n opts: jQuery.extend(true, {\n specialEasing: {},\n easing: jQuery.easing._default\n }, options),\n originalProperties: properties,\n originalOptions: options,\n startTime: fxNow || createFxNow(),\n duration: options.duration,\n tweens: [],\n createTween: function (prop, end) {\n var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);\n animation.tweens.push(tween);\n return tween;\n },\n stop: function (gotoEnd) {\n var index = 0,\n // If we are going to the end, we want to run all the tweens\n // otherwise we skip this part\n length = gotoEnd ? animation.tweens.length : 0;\n if (stopped) {\n return this;\n }\n stopped = true;\n for (; index < length; index++) {\n animation.tweens[index].run(1);\n }\n\n // Resolve when we played the last frame; otherwise, reject\n if (gotoEnd) {\n deferred.notifyWith(elem, [animation, 1, 0]);\n deferred.resolveWith(elem, [animation, gotoEnd]);\n } else {\n deferred.rejectWith(elem, [animation, gotoEnd]);\n }\n return this;\n }\n }),\n props = animation.props;\n propFilter(props, animation.opts.specialEasing);\n for (; index < length; index++) {\n result = Animation.prefilters[index].call(animation, elem, props, animation.opts);\n if (result) {\n if (isFunction(result.stop)) {\n jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);\n }\n return result;\n }\n }\n jQuery.map(props, createTween, animation);\n if (isFunction(animation.opts.start)) {\n animation.opts.start.call(elem, animation);\n }\n\n // Attach callbacks from options\n animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);\n jQuery.fx.timer(jQuery.extend(tick, {\n elem: elem,\n anim: animation,\n queue: animation.opts.queue\n }));\n return animation;\n }\n jQuery.Animation = jQuery.extend(Animation, {\n tweeners: {\n \"*\": [function (prop, value) {\n var tween = this.createTween(prop, value);\n adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);\n return tween;\n }]\n },\n tweener: function (props, callback) {\n if (isFunction(props)) {\n callback = props;\n props = [\"*\"];\n } else {\n props = props.match(rnothtmlwhite);\n }\n var prop,\n index = 0,\n length = props.length;\n for (; index < length; index++) {\n prop = props[index];\n Animation.tweeners[prop] = Animation.tweeners[prop] || [];\n Animation.tweeners[prop].unshift(callback);\n }\n },\n prefilters: [defaultPrefilter],\n prefilter: function (callback, prepend) {\n if (prepend) {\n Animation.prefilters.unshift(callback);\n } else {\n Animation.prefilters.push(callback);\n }\n }\n });\n jQuery.speed = function (speed, easing, fn) {\n var opt = speed && typeof speed === \"object\" ? jQuery.extend({}, speed) : {\n complete: fn || !fn && easing || isFunction(speed) && speed,\n duration: speed,\n easing: fn && easing || easing && !isFunction(easing) && easing\n };\n\n // Go to the end state if fx are off\n if (jQuery.fx.off) {\n opt.duration = 0;\n } else {\n if (typeof opt.duration !== \"number\") {\n if (opt.duration in jQuery.fx.speeds) {\n opt.duration = jQuery.fx.speeds[opt.duration];\n } else {\n opt.duration = jQuery.fx.speeds._default;\n }\n }\n }\n\n // Normalize opt.queue - true/undefined/null -> \"fx\"\n if (opt.queue == null || opt.queue === true) {\n opt.queue = \"fx\";\n }\n\n // Queueing\n opt.old = opt.complete;\n opt.complete = function () {\n if (isFunction(opt.old)) {\n opt.old.call(this);\n }\n if (opt.queue) {\n jQuery.dequeue(this, opt.queue);\n }\n };\n return opt;\n };\n jQuery.fn.extend({\n fadeTo: function (speed, to, easing, callback) {\n // Show any hidden elements after setting opacity to 0\n return this.filter(isHiddenWithinTree).css(\"opacity\", 0).show()\n\n // Animate to the value specified\n .end().animate({\n opacity: to\n }, speed, easing, callback);\n },\n animate: function (prop, speed, easing, callback) {\n var empty = jQuery.isEmptyObject(prop),\n optall = jQuery.speed(speed, easing, callback),\n doAnimation = function () {\n // Operate on a copy of prop so per-property easing won't be lost\n var anim = Animation(this, jQuery.extend({}, prop), optall);\n\n // Empty animations, or finishing resolves immediately\n if (empty || dataPriv.get(this, \"finish\")) {\n anim.stop(true);\n }\n };\n doAnimation.finish = doAnimation;\n return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);\n },\n stop: function (type, clearQueue, gotoEnd) {\n var stopQueue = function (hooks) {\n var stop = hooks.stop;\n delete hooks.stop;\n stop(gotoEnd);\n };\n if (typeof type !== \"string\") {\n gotoEnd = clearQueue;\n clearQueue = type;\n type = undefined;\n }\n if (clearQueue) {\n this.queue(type || \"fx\", []);\n }\n return this.each(function () {\n var dequeue = true,\n index = type != null && type + \"queueHooks\",\n timers = jQuery.timers,\n data = dataPriv.get(this);\n if (index) {\n if (data[index] && data[index].stop) {\n stopQueue(data[index]);\n }\n } else {\n for (index in data) {\n if (data[index] && data[index].stop && rrun.test(index)) {\n stopQueue(data[index]);\n }\n }\n }\n for (index = timers.length; index--;) {\n if (timers[index].elem === this && (type == null || timers[index].queue === type)) {\n timers[index].anim.stop(gotoEnd);\n dequeue = false;\n timers.splice(index, 1);\n }\n }\n\n // Start the next in the queue if the last step wasn't forced.\n // Timers currently will call their complete callbacks, which\n // will dequeue but only if they were gotoEnd.\n if (dequeue || !gotoEnd) {\n jQuery.dequeue(this, type);\n }\n });\n },\n finish: function (type) {\n if (type !== false) {\n type = type || \"fx\";\n }\n return this.each(function () {\n var index,\n data = dataPriv.get(this),\n queue = data[type + \"queue\"],\n hooks = data[type + \"queueHooks\"],\n timers = jQuery.timers,\n length = queue ? queue.length : 0;\n\n // Enable finishing flag on private data\n data.finish = true;\n\n // Empty the queue first\n jQuery.queue(this, type, []);\n if (hooks && hooks.stop) {\n hooks.stop.call(this, true);\n }\n\n // Look for any active animations, and finish them\n for (index = timers.length; index--;) {\n if (timers[index].elem === this && timers[index].queue === type) {\n timers[index].anim.stop(true);\n timers.splice(index, 1);\n }\n }\n\n // Look for any animations in the old queue and finish them\n for (index = 0; index < length; index++) {\n if (queue[index] && queue[index].finish) {\n queue[index].finish.call(this);\n }\n }\n\n // Turn off finishing flag\n delete data.finish;\n });\n }\n });\n jQuery.each([\"toggle\", \"show\", \"hide\"], function (_i, name) {\n var cssFn = jQuery.fn[name];\n jQuery.fn[name] = function (speed, easing, callback) {\n return speed == null || typeof speed === \"boolean\" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);\n };\n });\n\n // Generate shortcuts for custom animations\n jQuery.each({\n slideDown: genFx(\"show\"),\n slideUp: genFx(\"hide\"),\n slideToggle: genFx(\"toggle\"),\n fadeIn: {\n opacity: \"show\"\n },\n fadeOut: {\n opacity: \"hide\"\n },\n fadeToggle: {\n opacity: \"toggle\"\n }\n }, function (name, props) {\n jQuery.fn[name] = function (speed, easing, callback) {\n return this.animate(props, speed, easing, callback);\n };\n });\n jQuery.timers = [];\n jQuery.fx.tick = function () {\n var timer,\n i = 0,\n timers = jQuery.timers;\n fxNow = Date.now();\n for (; i < timers.length; i++) {\n timer = timers[i];\n\n // Run the timer and safely remove it when done (allowing for external removal)\n if (!timer() && timers[i] === timer) {\n timers.splice(i--, 1);\n }\n }\n if (!timers.length) {\n jQuery.fx.stop();\n }\n fxNow = undefined;\n };\n jQuery.fx.timer = function (timer) {\n jQuery.timers.push(timer);\n jQuery.fx.start();\n };\n jQuery.fx.interval = 13;\n jQuery.fx.start = function () {\n if (inProgress) {\n return;\n }\n inProgress = true;\n schedule();\n };\n jQuery.fx.stop = function () {\n inProgress = null;\n };\n jQuery.fx.speeds = {\n slow: 600,\n fast: 200,\n // Default speed\n _default: 400\n };\n\n // Based off of the plugin by Clint Helfers, with permission.\n jQuery.fn.delay = function (time, type) {\n time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;\n type = type || \"fx\";\n return this.queue(type, function (next, hooks) {\n var timeout = window.setTimeout(next, time);\n hooks.stop = function () {\n window.clearTimeout(timeout);\n };\n });\n };\n (function () {\n var input = document.createElement(\"input\"),\n select = document.createElement(\"select\"),\n opt = select.appendChild(document.createElement(\"option\"));\n input.type = \"checkbox\";\n\n // Support: Android <=4.3 only\n // Default value for a checkbox should be \"on\"\n support.checkOn = input.value !== \"\";\n\n // Support: IE <=11 only\n // Must access selectedIndex to make default options select\n support.optSelected = opt.selected;\n\n // Support: IE <=11 only\n // An input loses its value after becoming a radio\n input = document.createElement(\"input\");\n input.value = \"t\";\n input.type = \"radio\";\n support.radioValue = input.value === \"t\";\n })();\n var boolHook,\n attrHandle = jQuery.expr.attrHandle;\n jQuery.fn.extend({\n attr: function (name, value) {\n return access(this, jQuery.attr, name, value, arguments.length > 1);\n },\n removeAttr: function (name) {\n return this.each(function () {\n jQuery.removeAttr(this, name);\n });\n }\n });\n jQuery.extend({\n attr: function (elem, name, value) {\n var ret,\n hooks,\n nType = elem.nodeType;\n\n // Don't get/set attributes on text, comment and attribute nodes\n if (nType === 3 || nType === 8 || nType === 2) {\n return;\n }\n\n // Fallback to prop when attributes are not supported\n if (typeof elem.getAttribute === \"undefined\") {\n return jQuery.prop(elem, name, value);\n }\n\n // Attribute hooks are determined by the lowercase version\n // Grab necessary hook if one is defined\n if (nType !== 1 || !jQuery.isXMLDoc(elem)) {\n hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : undefined);\n }\n if (value !== undefined) {\n if (value === null) {\n jQuery.removeAttr(elem, name);\n return;\n }\n if (hooks && \"set\" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {\n return ret;\n }\n elem.setAttribute(name, value + \"\");\n return value;\n }\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, name)) !== null) {\n return ret;\n }\n ret = jQuery.find.attr(elem, name);\n\n // Non-existent attributes return null, we normalize to undefined\n return ret == null ? undefined : ret;\n },\n attrHooks: {\n type: {\n set: function (elem, value) {\n if (!support.radioValue && value === \"radio\" && nodeName(elem, \"input\")) {\n var val = elem.value;\n elem.setAttribute(\"type\", value);\n if (val) {\n elem.value = val;\n }\n return value;\n }\n }\n }\n },\n removeAttr: function (elem, value) {\n var name,\n i = 0,\n // Attribute names can contain non-HTML whitespace characters\n // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n attrNames = value && value.match(rnothtmlwhite);\n if (attrNames && elem.nodeType === 1) {\n while (name = attrNames[i++]) {\n elem.removeAttribute(name);\n }\n }\n }\n });\n\n // Hooks for boolean attributes\n boolHook = {\n set: function (elem, value, name) {\n if (value === false) {\n // Remove boolean attributes when set to false\n jQuery.removeAttr(elem, name);\n } else {\n elem.setAttribute(name, name);\n }\n return name;\n }\n };\n jQuery.each(jQuery.expr.match.bool.source.match(/\\w+/g), function (_i, name) {\n var getter = attrHandle[name] || jQuery.find.attr;\n attrHandle[name] = function (elem, name, isXML) {\n var ret,\n handle,\n lowercaseName = name.toLowerCase();\n if (!isXML) {\n // Avoid an infinite loop by temporarily removing this function from the getter\n handle = attrHandle[lowercaseName];\n attrHandle[lowercaseName] = ret;\n ret = getter(elem, name, isXML) != null ? lowercaseName : null;\n attrHandle[lowercaseName] = handle;\n }\n return ret;\n };\n });\n var rfocusable = /^(?:input|select|textarea|button)$/i,\n rclickable = /^(?:a|area)$/i;\n jQuery.fn.extend({\n prop: function (name, value) {\n return access(this, jQuery.prop, name, value, arguments.length > 1);\n },\n removeProp: function (name) {\n return this.each(function () {\n delete this[jQuery.propFix[name] || name];\n });\n }\n });\n jQuery.extend({\n prop: function (elem, name, value) {\n var ret,\n hooks,\n nType = elem.nodeType;\n\n // Don't get/set properties on text, comment and attribute nodes\n if (nType === 3 || nType === 8 || nType === 2) {\n return;\n }\n if (nType !== 1 || !jQuery.isXMLDoc(elem)) {\n // Fix name and attach hooks\n name = jQuery.propFix[name] || name;\n hooks = jQuery.propHooks[name];\n }\n if (value !== undefined) {\n if (hooks && \"set\" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {\n return ret;\n }\n return elem[name] = value;\n }\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, name)) !== null) {\n return ret;\n }\n return elem[name];\n },\n propHooks: {\n tabIndex: {\n get: function (elem) {\n // Support: IE <=9 - 11 only\n // elem.tabIndex doesn't always return the\n // correct value when it hasn't been explicitly set\n // Use proper attribute retrieval (trac-12072)\n var tabindex = jQuery.find.attr(elem, \"tabindex\");\n if (tabindex) {\n return parseInt(tabindex, 10);\n }\n if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {\n return 0;\n }\n return -1;\n }\n }\n },\n propFix: {\n \"for\": \"htmlFor\",\n \"class\": \"className\"\n }\n });\n\n // Support: IE <=11 only\n // Accessing the selectedIndex property\n // forces the browser to respect setting selected\n // on the option\n // The getter ensures a default option is selected\n // when in an optgroup\n // eslint rule \"no-unused-expressions\" is disabled for this code\n // since it considers such accessions noop\n if (!support.optSelected) {\n jQuery.propHooks.selected = {\n get: function (elem) {\n /* eslint no-unused-expressions: \"off\" */\n\n var parent = elem.parentNode;\n if (parent && parent.parentNode) {\n parent.parentNode.selectedIndex;\n }\n return null;\n },\n set: function (elem) {\n /* eslint no-unused-expressions: \"off\" */\n\n var parent = elem.parentNode;\n if (parent) {\n parent.selectedIndex;\n if (parent.parentNode) {\n parent.parentNode.selectedIndex;\n }\n }\n }\n };\n }\n jQuery.each([\"tabIndex\", \"readOnly\", \"maxLength\", \"cellSpacing\", \"cellPadding\", \"rowSpan\", \"colSpan\", \"useMap\", \"frameBorder\", \"contentEditable\"], function () {\n jQuery.propFix[this.toLowerCase()] = this;\n });\n\n // Strip and collapse whitespace according to HTML spec\n // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }\n function getClass(elem) {\n return elem.getAttribute && elem.getAttribute(\"class\") || \"\";\n }\n function classesToArray(value) {\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value === \"string\") {\n return value.match(rnothtmlwhite) || [];\n }\n return [];\n }\n jQuery.fn.extend({\n addClass: function (value) {\n var classNames, cur, curValue, className, i, finalValue;\n if (isFunction(value)) {\n return this.each(function (j) {\n jQuery(this).addClass(value.call(this, j, getClass(this)));\n });\n }\n classNames = classesToArray(value);\n if (classNames.length) {\n return this.each(function () {\n curValue = getClass(this);\n cur = this.nodeType === 1 && \" \" + stripAndCollapse(curValue) + \" \";\n if (cur) {\n for (i = 0; i < classNames.length; i++) {\n className = classNames[i];\n if (cur.indexOf(\" \" + className + \" \") < 0) {\n cur += className + \" \";\n }\n }\n\n // Only assign if different to avoid unneeded rendering.\n finalValue = stripAndCollapse(cur);\n if (curValue !== finalValue) {\n this.setAttribute(\"class\", finalValue);\n }\n }\n });\n }\n return this;\n },\n removeClass: function (value) {\n var classNames, cur, curValue, className, i, finalValue;\n if (isFunction(value)) {\n return this.each(function (j) {\n jQuery(this).removeClass(value.call(this, j, getClass(this)));\n });\n }\n if (!arguments.length) {\n return this.attr(\"class\", \"\");\n }\n classNames = classesToArray(value);\n if (classNames.length) {\n return this.each(function () {\n curValue = getClass(this);\n\n // This expression is here for better compressibility (see addClass)\n cur = this.nodeType === 1 && \" \" + stripAndCollapse(curValue) + \" \";\n if (cur) {\n for (i = 0; i < classNames.length; i++) {\n className = classNames[i];\n\n // Remove *all* instances\n while (cur.indexOf(\" \" + className + \" \") > -1) {\n cur = cur.replace(\" \" + className + \" \", \" \");\n }\n }\n\n // Only assign if different to avoid unneeded rendering.\n finalValue = stripAndCollapse(cur);\n if (curValue !== finalValue) {\n this.setAttribute(\"class\", finalValue);\n }\n }\n });\n }\n return this;\n },\n toggleClass: function (value, stateVal) {\n var classNames,\n className,\n i,\n self,\n type = typeof value,\n isValidValue = type === \"string\" || Array.isArray(value);\n if (isFunction(value)) {\n return this.each(function (i) {\n jQuery(this).toggleClass(value.call(this, i, getClass(this), stateVal), stateVal);\n });\n }\n if (typeof stateVal === \"boolean\" && isValidValue) {\n return stateVal ? this.addClass(value) : this.removeClass(value);\n }\n classNames = classesToArray(value);\n return this.each(function () {\n if (isValidValue) {\n // Toggle individual class names\n self = jQuery(this);\n for (i = 0; i < classNames.length; i++) {\n className = classNames[i];\n\n // Check each className given, space separated list\n if (self.hasClass(className)) {\n self.removeClass(className);\n } else {\n self.addClass(className);\n }\n }\n\n // Toggle whole class name\n } else if (value === undefined || type === \"boolean\") {\n className = getClass(this);\n if (className) {\n // Store className if set\n dataPriv.set(this, \"__className__\", className);\n }\n\n // If the element has a class name or if we're passed `false`,\n // then remove the whole classname (if there was one, the above saved it).\n // Otherwise bring back whatever was previously saved (if anything),\n // falling back to the empty string if nothing was stored.\n if (this.setAttribute) {\n this.setAttribute(\"class\", className || value === false ? \"\" : dataPriv.get(this, \"__className__\") || \"\");\n }\n }\n });\n },\n hasClass: function (selector) {\n var className,\n elem,\n i = 0;\n className = \" \" + selector + \" \";\n while (elem = this[i++]) {\n if (elem.nodeType === 1 && (\" \" + stripAndCollapse(getClass(elem)) + \" \").indexOf(className) > -1) {\n return true;\n }\n }\n return false;\n }\n });\n var rreturn = /\\r/g;\n jQuery.fn.extend({\n val: function (value) {\n var hooks,\n ret,\n valueIsFunction,\n elem = this[0];\n if (!arguments.length) {\n if (elem) {\n hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];\n if (hooks && \"get\" in hooks && (ret = hooks.get(elem, \"value\")) !== undefined) {\n return ret;\n }\n ret = elem.value;\n\n // Handle most common string cases\n if (typeof ret === \"string\") {\n return ret.replace(rreturn, \"\");\n }\n\n // Handle cases where value is null/undef or number\n return ret == null ? \"\" : ret;\n }\n return;\n }\n valueIsFunction = isFunction(value);\n return this.each(function (i) {\n var val;\n if (this.nodeType !== 1) {\n return;\n }\n if (valueIsFunction) {\n val = value.call(this, i, jQuery(this).val());\n } else {\n val = value;\n }\n\n // Treat null/undefined as \"\"; convert numbers to string\n if (val == null) {\n val = \"\";\n } else if (typeof val === \"number\") {\n val += \"\";\n } else if (Array.isArray(val)) {\n val = jQuery.map(val, function (value) {\n return value == null ? \"\" : value + \"\";\n });\n }\n hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];\n\n // If set returns undefined, fall back to normal setting\n if (!hooks || !(\"set\" in hooks) || hooks.set(this, val, \"value\") === undefined) {\n this.value = val;\n }\n });\n }\n });\n jQuery.extend({\n valHooks: {\n option: {\n get: function (elem) {\n var val = jQuery.find.attr(elem, \"value\");\n return val != null ? val :\n // Support: IE <=10 - 11 only\n // option.text throws exceptions (trac-14686, trac-14858)\n // Strip and collapse whitespace\n // https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n stripAndCollapse(jQuery.text(elem));\n }\n },\n select: {\n get: function (elem) {\n var value,\n option,\n i,\n options = elem.options,\n index = elem.selectedIndex,\n one = elem.type === \"select-one\",\n values = one ? null : [],\n max = one ? index + 1 : options.length;\n if (index < 0) {\n i = max;\n } else {\n i = one ? index : 0;\n }\n\n // Loop through all the selected options\n for (; i < max; i++) {\n option = options[i];\n\n // Support: IE <=9 only\n // IE8-9 doesn't update selected after form reset (trac-2551)\n if ((option.selected || i === index) &&\n // Don't return options that are disabled or in a disabled optgroup\n !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, \"optgroup\"))) {\n // Get the specific value for the option\n value = jQuery(option).val();\n\n // We don't need an array for one selects\n if (one) {\n return value;\n }\n\n // Multi-Selects return an array\n values.push(value);\n }\n }\n return values;\n },\n set: function (elem, value) {\n var optionSet,\n option,\n options = elem.options,\n values = jQuery.makeArray(value),\n i = options.length;\n while (i--) {\n option = options[i];\n\n /* eslint-disable no-cond-assign */\n\n if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {\n optionSet = true;\n }\n\n /* eslint-enable no-cond-assign */\n }\n\n // Force browsers to behave consistently when non-matching value is set\n if (!optionSet) {\n elem.selectedIndex = -1;\n }\n return values;\n }\n }\n }\n });\n\n // Radios and checkboxes getter/setter\n jQuery.each([\"radio\", \"checkbox\"], function () {\n jQuery.valHooks[this] = {\n set: function (elem, value) {\n if (Array.isArray(value)) {\n return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;\n }\n }\n };\n if (!support.checkOn) {\n jQuery.valHooks[this].get = function (elem) {\n return elem.getAttribute(\"value\") === null ? \"on\" : elem.value;\n };\n }\n });\n\n // Return jQuery for attributes-only inclusion\n var location = window.location;\n var nonce = {\n guid: Date.now()\n };\n var rquery = /\\?/;\n\n // Cross-browser xml parsing\n jQuery.parseXML = function (data) {\n var xml, parserErrorElem;\n if (!data || typeof data !== \"string\") {\n return null;\n }\n\n // Support: IE 9 - 11 only\n // IE throws on parseFromString with invalid input.\n try {\n xml = new window.DOMParser().parseFromString(data, \"text/xml\");\n } catch (e) {}\n parserErrorElem = xml && xml.getElementsByTagName(\"parsererror\")[0];\n if (!xml || parserErrorElem) {\n jQuery.error(\"Invalid XML: \" + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function (el) {\n return el.textContent;\n }).join(\"\\n\") : data));\n }\n return xml;\n };\n var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n stopPropagationCallback = function (e) {\n e.stopPropagation();\n };\n jQuery.extend(jQuery.event, {\n trigger: function (event, data, elem, onlyHandlers) {\n var i,\n cur,\n tmp,\n bubbleType,\n ontype,\n handle,\n special,\n lastElement,\n eventPath = [elem || document],\n type = hasOwn.call(event, \"type\") ? event.type : event,\n namespaces = hasOwn.call(event, \"namespace\") ? event.namespace.split(\".\") : [];\n cur = lastElement = tmp = elem = elem || document;\n\n // Don't do events on text and comment nodes\n if (elem.nodeType === 3 || elem.nodeType === 8) {\n return;\n }\n\n // focus/blur morphs to focusin/out; ensure we're not firing them right now\n if (rfocusMorph.test(type + jQuery.event.triggered)) {\n return;\n }\n if (type.indexOf(\".\") > -1) {\n // Namespaced trigger; create a regexp to match event type in handle()\n namespaces = type.split(\".\");\n type = namespaces.shift();\n namespaces.sort();\n }\n ontype = type.indexOf(\":\") < 0 && \"on\" + type;\n\n // Caller can pass in a jQuery.Event object, Object, or just an event type string\n event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === \"object\" && event);\n\n // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n event.isTrigger = onlyHandlers ? 2 : 3;\n event.namespace = namespaces.join(\".\");\n event.rnamespace = event.namespace ? new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\") : null;\n\n // Clean up the event in case it is being reused\n event.result = undefined;\n if (!event.target) {\n event.target = elem;\n }\n\n // Clone any incoming data and prepend the event, creating the handler arg list\n data = data == null ? [event] : jQuery.makeArray(data, [event]);\n\n // Allow special events to draw outside the lines\n special = jQuery.event.special[type] || {};\n if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {\n return;\n }\n\n // Determine event propagation path in advance, per W3C events spec (trac-9951)\n // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)\n if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {\n bubbleType = special.delegateType || type;\n if (!rfocusMorph.test(bubbleType + type)) {\n cur = cur.parentNode;\n }\n for (; cur; cur = cur.parentNode) {\n eventPath.push(cur);\n tmp = cur;\n }\n\n // Only add window if we got to document (e.g., not plain obj or detached DOM)\n if (tmp === (elem.ownerDocument || document)) {\n eventPath.push(tmp.defaultView || tmp.parentWindow || window);\n }\n }\n\n // Fire handlers on the event path\n i = 0;\n while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {\n lastElement = cur;\n event.type = i > 1 ? bubbleType : special.bindType || type;\n\n // jQuery handler\n handle = (dataPriv.get(cur, \"events\") || Object.create(null))[event.type] && dataPriv.get(cur, \"handle\");\n if (handle) {\n handle.apply(cur, data);\n }\n\n // Native handler\n handle = ontype && cur[ontype];\n if (handle && handle.apply && acceptData(cur)) {\n event.result = handle.apply(cur, data);\n if (event.result === false) {\n event.preventDefault();\n }\n }\n }\n event.type = type;\n\n // If nobody prevented the default action, do it now\n if (!onlyHandlers && !event.isDefaultPrevented()) {\n if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {\n // Call a native DOM method on the target with the same name as the event.\n // Don't do default actions on window, that's where global variables be (trac-6170)\n if (ontype && isFunction(elem[type]) && !isWindow(elem)) {\n // Don't re-trigger an onFOO event when we call its FOO() method\n tmp = elem[ontype];\n if (tmp) {\n elem[ontype] = null;\n }\n\n // Prevent re-triggering of the same event, since we already bubbled it above\n jQuery.event.triggered = type;\n if (event.isPropagationStopped()) {\n lastElement.addEventListener(type, stopPropagationCallback);\n }\n elem[type]();\n if (event.isPropagationStopped()) {\n lastElement.removeEventListener(type, stopPropagationCallback);\n }\n jQuery.event.triggered = undefined;\n if (tmp) {\n elem[ontype] = tmp;\n }\n }\n }\n }\n return event.result;\n },\n // Piggyback on a donor event to simulate a different one\n // Used only for `focus(in | out)` events\n simulate: function (type, elem, event) {\n var e = jQuery.extend(new jQuery.Event(), event, {\n type: type,\n isSimulated: true\n });\n jQuery.event.trigger(e, null, elem);\n }\n });\n jQuery.fn.extend({\n trigger: function (type, data) {\n return this.each(function () {\n jQuery.event.trigger(type, data, this);\n });\n },\n triggerHandler: function (type, data) {\n var elem = this[0];\n if (elem) {\n return jQuery.event.trigger(type, data, elem, true);\n }\n }\n });\n var rbracket = /\\[\\]$/,\n rCRLF = /\\r?\\n/g,\n rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n rsubmittable = /^(?:input|select|textarea|keygen)/i;\n function buildParams(prefix, obj, traditional, add) {\n var name;\n if (Array.isArray(obj)) {\n // Serialize array item.\n jQuery.each(obj, function (i, v) {\n if (traditional || rbracket.test(prefix)) {\n // Treat each array item as a scalar.\n add(prefix, v);\n } else {\n // Item is non-scalar (array or object), encode its numeric index.\n buildParams(prefix + \"[\" + (typeof v === \"object\" && v != null ? i : \"\") + \"]\", v, traditional, add);\n }\n });\n } else if (!traditional && toType(obj) === \"object\") {\n // Serialize object item.\n for (name in obj) {\n buildParams(prefix + \"[\" + name + \"]\", obj[name], traditional, add);\n }\n } else {\n // Serialize scalar item.\n add(prefix, obj);\n }\n }\n\n // Serialize an array of form elements or a set of\n // key/values into a query string\n jQuery.param = function (a, traditional) {\n var prefix,\n s = [],\n add = function (key, valueOrFunction) {\n // If value is a function, invoke it and use its return value\n var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;\n s[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value == null ? \"\" : value);\n };\n if (a == null) {\n return \"\";\n }\n\n // If an array was passed in, assume that it is an array of form elements.\n if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {\n // Serialize the form elements\n jQuery.each(a, function () {\n add(this.name, this.value);\n });\n } else {\n // If traditional, encode the \"old\" way (the way 1.3.2 or older\n // did it), otherwise encode params recursively.\n for (prefix in a) {\n buildParams(prefix, a[prefix], traditional, add);\n }\n }\n\n // Return the resulting serialization\n return s.join(\"&\");\n };\n jQuery.fn.extend({\n serialize: function () {\n return jQuery.param(this.serializeArray());\n },\n serializeArray: function () {\n return this.map(function () {\n // Can add propHook for \"elements\" to filter or add form elements\n var elements = jQuery.prop(this, \"elements\");\n return elements ? jQuery.makeArray(elements) : this;\n }).filter(function () {\n var type = this.type;\n\n // Use .is( \":disabled\" ) so that fieldset[disabled] works\n return this.name && !jQuery(this).is(\":disabled\") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));\n }).map(function (_i, elem) {\n var val = jQuery(this).val();\n if (val == null) {\n return null;\n }\n if (Array.isArray(val)) {\n return jQuery.map(val, function (val) {\n return {\n name: elem.name,\n value: val.replace(rCRLF, \"\\r\\n\")\n };\n });\n }\n return {\n name: elem.name,\n value: val.replace(rCRLF, \"\\r\\n\")\n };\n }).get();\n }\n });\n var r20 = /%20/g,\n rhash = /#.*$/,\n rantiCache = /([?&])_=[^&]*/,\n rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n // trac-7653, trac-8125, trac-8152: local protocol detection\n rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n rnoContent = /^(?:GET|HEAD)$/,\n rprotocol = /^\\/\\//,\n /* Prefilters\n * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n * 2) These are called:\n * - BEFORE asking for a transport\n * - AFTER param serialization (s.data is a string if s.processData is true)\n * 3) key is the dataType\n * 4) the catchall symbol \"*\" can be used\n * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\n */\n prefilters = {},\n /* Transports bindings\n * 1) key is the dataType\n * 2) the catchall symbol \"*\" can be used\n * 3) selection will start with transport dataType and THEN go to \"*\" if needed\n */\n transports = {},\n // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression\n allTypes = \"*/\".concat(\"*\"),\n // Anchor tag for parsing the document origin\n originAnchor = document.createElement(\"a\");\n originAnchor.href = location.href;\n\n // Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\n function addToPrefiltersOrTransports(structure) {\n // dataTypeExpression is optional and defaults to \"*\"\n return function (dataTypeExpression, func) {\n if (typeof dataTypeExpression !== \"string\") {\n func = dataTypeExpression;\n dataTypeExpression = \"*\";\n }\n var dataType,\n i = 0,\n dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];\n if (isFunction(func)) {\n // For each dataType in the dataTypeExpression\n while (dataType = dataTypes[i++]) {\n // Prepend if requested\n if (dataType[0] === \"+\") {\n dataType = dataType.slice(1) || \"*\";\n (structure[dataType] = structure[dataType] || []).unshift(func);\n\n // Otherwise append\n } else {\n (structure[dataType] = structure[dataType] || []).push(func);\n }\n }\n }\n };\n }\n\n // Base inspection function for prefilters and transports\n function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\n var inspected = {},\n seekingTransport = structure === transports;\n function inspect(dataType) {\n var selected;\n inspected[dataType] = true;\n jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {\n var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\n if (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[dataTypeOrTransport]) {\n options.dataTypes.unshift(dataTypeOrTransport);\n inspect(dataTypeOrTransport);\n return false;\n } else if (seekingTransport) {\n return !(selected = dataTypeOrTransport);\n }\n });\n return selected;\n }\n return inspect(options.dataTypes[0]) || !inspected[\"*\"] && inspect(\"*\");\n }\n\n // A special extend for ajax options\n // that takes \"flat\" options (not to be deep extended)\n // Fixes trac-9887\n function ajaxExtend(target, src) {\n var key,\n deep,\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\n for (key in src) {\n if (src[key] !== undefined) {\n (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];\n }\n }\n if (deep) {\n jQuery.extend(true, target, deep);\n }\n return target;\n }\n\n /* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\n function ajaxHandleResponses(s, jqXHR, responses) {\n var ct,\n type,\n finalDataType,\n firstDataType,\n contents = s.contents,\n dataTypes = s.dataTypes;\n\n // Remove auto dataType and get content-type in the process\n while (dataTypes[0] === \"*\") {\n dataTypes.shift();\n if (ct === undefined) {\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\n }\n }\n\n // Check if we're dealing with a known content-type\n if (ct) {\n for (type in contents) {\n if (contents[type] && contents[type].test(ct)) {\n dataTypes.unshift(type);\n break;\n }\n }\n }\n\n // Check to see if we have a response for the expected dataType\n if (dataTypes[0] in responses) {\n finalDataType = dataTypes[0];\n } else {\n // Try convertible dataTypes\n for (type in responses) {\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\n finalDataType = type;\n break;\n }\n if (!firstDataType) {\n firstDataType = type;\n }\n }\n\n // Or just use first one\n finalDataType = finalDataType || firstDataType;\n }\n\n // If we found a dataType\n // We add the dataType to the list if needed\n // and return the corresponding response\n if (finalDataType) {\n if (finalDataType !== dataTypes[0]) {\n dataTypes.unshift(finalDataType);\n }\n return responses[finalDataType];\n }\n }\n\n /* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\n function ajaxConvert(s, response, jqXHR, isSuccess) {\n var conv2,\n current,\n conv,\n tmp,\n prev,\n converters = {},\n // Work with a copy of dataTypes in case we need to modify it for conversion\n dataTypes = s.dataTypes.slice();\n\n // Create converters map with lowercased keys\n if (dataTypes[1]) {\n for (conv in s.converters) {\n converters[conv.toLowerCase()] = s.converters[conv];\n }\n }\n current = dataTypes.shift();\n\n // Convert to each sequential dataType\n while (current) {\n if (s.responseFields[current]) {\n jqXHR[s.responseFields[current]] = response;\n }\n\n // Apply the dataFilter if provided\n if (!prev && isSuccess && s.dataFilter) {\n response = s.dataFilter(response, s.dataType);\n }\n prev = current;\n current = dataTypes.shift();\n if (current) {\n // There's only work to do if current dataType is non-auto\n if (current === \"*\") {\n current = prev;\n\n // Convert response if prev dataType is non-auto and differs from current\n } else if (prev !== \"*\" && prev !== current) {\n // Seek a direct converter\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\n\n // If none found, seek a pair\n if (!conv) {\n for (conv2 in converters) {\n // If conv2 outputs current\n tmp = conv2.split(\" \");\n if (tmp[1] === current) {\n // If prev can be converted to accepted input\n conv = converters[prev + \" \" + tmp[0]] || converters[\"* \" + tmp[0]];\n if (conv) {\n // Condense equivalence converters\n if (conv === true) {\n conv = converters[conv2];\n\n // Otherwise, insert the intermediate dataType\n } else if (converters[conv2] !== true) {\n current = tmp[0];\n dataTypes.unshift(tmp[1]);\n }\n break;\n }\n }\n }\n }\n\n // Apply converter (if not an equivalence)\n if (conv !== true) {\n // Unless errors are allowed to bubble, catch and return them\n if (conv && s.throws) {\n response = conv(response);\n } else {\n try {\n response = conv(response);\n } catch (e) {\n return {\n state: \"parsererror\",\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\n };\n }\n }\n }\n }\n }\n }\n return {\n state: \"success\",\n data: response\n };\n }\n jQuery.extend({\n // Counter for holding the number of active queries\n active: 0,\n // Last-Modified header cache for next request\n lastModified: {},\n etag: {},\n ajaxSettings: {\n url: location.href,\n type: \"GET\",\n isLocal: rlocalProtocol.test(location.protocol),\n global: true,\n processData: true,\n async: true,\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n /*\n timeout: 0,\n data: null,\n dataType: null,\n username: null,\n password: null,\n cache: null,\n throws: false,\n traditional: false,\n headers: {},\n */\n\n accepts: {\n \"*\": allTypes,\n text: \"text/plain\",\n html: \"text/html\",\n xml: \"application/xml, text/xml\",\n json: \"application/json, text/javascript\"\n },\n contents: {\n xml: /\\bxml\\b/,\n html: /\\bhtml/,\n json: /\\bjson\\b/\n },\n responseFields: {\n xml: \"responseXML\",\n text: \"responseText\",\n json: \"responseJSON\"\n },\n // Data converters\n // Keys separate source (or catchall \"*\") and destination types with a single space\n converters: {\n // Convert anything to text\n \"* text\": String,\n // Text to html (true = no transformation)\n \"text html\": true,\n // Evaluate text as a json expression\n \"text json\": JSON.parse,\n // Parse text as xml\n \"text xml\": jQuery.parseXML\n },\n // For options that shouldn't be deep extended:\n // you can add your own custom options here if\n // and when you create one that shouldn't be\n // deep extended (see ajaxExtend)\n flatOptions: {\n url: true,\n context: true\n }\n },\n // Creates a full fledged settings object into target\n // with both ajaxSettings and settings fields.\n // If target is omitted, writes into ajaxSettings.\n ajaxSetup: function (target, settings) {\n return settings ?\n // Building a settings object\n ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :\n // Extending ajaxSettings\n ajaxExtend(jQuery.ajaxSettings, target);\n },\n ajaxPrefilter: addToPrefiltersOrTransports(prefilters),\n ajaxTransport: addToPrefiltersOrTransports(transports),\n // Main method\n ajax: function (url, options) {\n // If url is an object, simulate pre-1.5 signature\n if (typeof url === \"object\") {\n options = url;\n url = undefined;\n }\n\n // Force options to be an object\n options = options || {};\n var transport,\n // URL without anti-cache param\n cacheURL,\n // Response headers\n responseHeadersString,\n responseHeaders,\n // timeout handle\n timeoutTimer,\n // Url cleanup var\n urlAnchor,\n // Request state (becomes false upon send and true upon completion)\n completed,\n // To know if global events are to be dispatched\n fireGlobals,\n // Loop variable\n i,\n // uncached part of the url\n uncached,\n // Create the final options object\n s = jQuery.ajaxSetup({}, options),\n // Callbacks context\n callbackContext = s.context || s,\n // Context for global events is callbackContext if it is a DOM node or jQuery collection\n globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event,\n // Deferreds\n deferred = jQuery.Deferred(),\n completeDeferred = jQuery.Callbacks(\"once memory\"),\n // Status-dependent callbacks\n statusCode = s.statusCode || {},\n // Headers (they are sent all at once)\n requestHeaders = {},\n requestHeadersNames = {},\n // Default abort message\n strAbort = \"canceled\",\n // Fake xhr\n jqXHR = {\n readyState: 0,\n // Builds headers hashtable if needed\n getResponseHeader: function (key) {\n var match;\n if (completed) {\n if (!responseHeaders) {\n responseHeaders = {};\n while (match = rheaders.exec(responseHeadersString)) {\n responseHeaders[match[1].toLowerCase() + \" \"] = (responseHeaders[match[1].toLowerCase() + \" \"] || []).concat(match[2]);\n }\n }\n match = responseHeaders[key.toLowerCase() + \" \"];\n }\n return match == null ? null : match.join(\", \");\n },\n // Raw string\n getAllResponseHeaders: function () {\n return completed ? responseHeadersString : null;\n },\n // Caches the header\n setRequestHeader: function (name, value) {\n if (completed == null) {\n name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;\n requestHeaders[name] = value;\n }\n return this;\n },\n // Overrides response content-type header\n overrideMimeType: function (type) {\n if (completed == null) {\n s.mimeType = type;\n }\n return this;\n },\n // Status-dependent callbacks\n statusCode: function (map) {\n var code;\n if (map) {\n if (completed) {\n // Execute the appropriate callbacks\n jqXHR.always(map[jqXHR.status]);\n } else {\n // Lazy-add the new callbacks in a way that preserves old ones\n for (code in map) {\n statusCode[code] = [statusCode[code], map[code]];\n }\n }\n }\n return this;\n },\n // Cancel the request\n abort: function (statusText) {\n var finalText = statusText || strAbort;\n if (transport) {\n transport.abort(finalText);\n }\n done(0, finalText);\n return this;\n }\n };\n\n // Attach deferreds\n deferred.promise(jqXHR);\n\n // Add protocol if not provided (prefilters might expect it)\n // Handle falsy url in the settings object (trac-10093: consistency with old signature)\n // We also use the url parameter if available\n s.url = ((url || s.url || location.href) + \"\").replace(rprotocol, location.protocol + \"//\");\n\n // Alias method option to type as per ticket trac-12004\n s.type = options.method || options.type || s.method || s.type;\n\n // Extract dataTypes list\n s.dataTypes = (s.dataType || \"*\").toLowerCase().match(rnothtmlwhite) || [\"\"];\n\n // A cross-domain request is in order when the origin doesn't match the current origin.\n if (s.crossDomain == null) {\n urlAnchor = document.createElement(\"a\");\n\n // Support: IE <=8 - 11, Edge 12 - 15\n // IE throws exception on accessing the href property if url is malformed,\n // e.g. http://example.com:80x/\n try {\n urlAnchor.href = s.url;\n\n // Support: IE <=8 - 11 only\n // Anchor's host property isn't correctly set when s.url is relative\n urlAnchor.href = urlAnchor.href;\n s.crossDomain = originAnchor.protocol + \"//\" + originAnchor.host !== urlAnchor.protocol + \"//\" + urlAnchor.host;\n } catch (e) {\n // If there is an error parsing the URL, assume it is crossDomain,\n // it can be rejected by the transport if it is invalid\n s.crossDomain = true;\n }\n }\n\n // Convert data if not already a string\n if (s.data && s.processData && typeof s.data !== \"string\") {\n s.data = jQuery.param(s.data, s.traditional);\n }\n\n // Apply prefilters\n inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);\n\n // If request was aborted inside a prefilter, stop there\n if (completed) {\n return jqXHR;\n }\n\n // We can fire global events as of now if asked to\n // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)\n fireGlobals = jQuery.event && s.global;\n\n // Watch for a new set of requests\n if (fireGlobals && jQuery.active++ === 0) {\n jQuery.event.trigger(\"ajaxStart\");\n }\n\n // Uppercase the type\n s.type = s.type.toUpperCase();\n\n // Determine if request has content\n s.hasContent = !rnoContent.test(s.type);\n\n // Save the URL in case we're toying with the If-Modified-Since\n // and/or If-None-Match header later on\n // Remove hash to simplify url manipulation\n cacheURL = s.url.replace(rhash, \"\");\n\n // More options handling for requests with no content\n if (!s.hasContent) {\n // Remember the hash so we can put it back\n uncached = s.url.slice(cacheURL.length);\n\n // If data is available and should be processed, append data to url\n if (s.data && (s.processData || typeof s.data === \"string\")) {\n cacheURL += (rquery.test(cacheURL) ? \"&\" : \"?\") + s.data;\n\n // trac-9682: remove data so that it's not used in an eventual retry\n delete s.data;\n }\n\n // Add or update anti-cache param if needed\n if (s.cache === false) {\n cacheURL = cacheURL.replace(rantiCache, \"$1\");\n uncached = (rquery.test(cacheURL) ? \"&\" : \"?\") + \"_=\" + nonce.guid++ + uncached;\n }\n\n // Put hash and anti-cache on the URL that will be requested (gh-1732)\n s.url = cacheURL + uncached;\n\n // Change '%20' to '+' if this is encoded form body content (gh-2658)\n } else if (s.data && s.processData && (s.contentType || \"\").indexOf(\"application/x-www-form-urlencoded\") === 0) {\n s.data = s.data.replace(r20, \"+\");\n }\n\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n if (s.ifModified) {\n if (jQuery.lastModified[cacheURL]) {\n jqXHR.setRequestHeader(\"If-Modified-Since\", jQuery.lastModified[cacheURL]);\n }\n if (jQuery.etag[cacheURL]) {\n jqXHR.setRequestHeader(\"If-None-Match\", jQuery.etag[cacheURL]);\n }\n }\n\n // Set the correct header, if data is being sent\n if (s.data && s.hasContent && s.contentType !== false || options.contentType) {\n jqXHR.setRequestHeader(\"Content-Type\", s.contentType);\n }\n\n // Set the Accepts header for the server, depending on the dataType\n jqXHR.setRequestHeader(\"Accept\", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\") : s.accepts[\"*\"]);\n\n // Check for headers option\n for (i in s.headers) {\n jqXHR.setRequestHeader(i, s.headers[i]);\n }\n\n // Allow custom headers/mimetypes and early abort\n if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed)) {\n // Abort if not done already and return\n return jqXHR.abort();\n }\n\n // Aborting is no longer a cancellation\n strAbort = \"abort\";\n\n // Install callbacks on deferreds\n completeDeferred.add(s.complete);\n jqXHR.done(s.success);\n jqXHR.fail(s.error);\n\n // Get transport\n transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);\n\n // If no transport, we auto-abort\n if (!transport) {\n done(-1, \"No Transport\");\n } else {\n jqXHR.readyState = 1;\n\n // Send global event\n if (fireGlobals) {\n globalEventContext.trigger(\"ajaxSend\", [jqXHR, s]);\n }\n\n // If request was aborted inside ajaxSend, stop there\n if (completed) {\n return jqXHR;\n }\n\n // Timeout\n if (s.async && s.timeout > 0) {\n timeoutTimer = window.setTimeout(function () {\n jqXHR.abort(\"timeout\");\n }, s.timeout);\n }\n try {\n completed = false;\n transport.send(requestHeaders, done);\n } catch (e) {\n // Rethrow post-completion exceptions\n if (completed) {\n throw e;\n }\n\n // Propagate others as results\n done(-1, e);\n }\n }\n\n // Callback for when everything is done\n function done(status, nativeStatusText, responses, headers) {\n var isSuccess,\n success,\n error,\n response,\n modified,\n statusText = nativeStatusText;\n\n // Ignore repeat invocations\n if (completed) {\n return;\n }\n completed = true;\n\n // Clear timeout if it exists\n if (timeoutTimer) {\n window.clearTimeout(timeoutTimer);\n }\n\n // Dereference transport for early garbage collection\n // (no matter how long the jqXHR object will be used)\n transport = undefined;\n\n // Cache response headers\n responseHeadersString = headers || \"\";\n\n // Set readyState\n jqXHR.readyState = status > 0 ? 4 : 0;\n\n // Determine if successful\n isSuccess = status >= 200 && status < 300 || status === 304;\n\n // Get response data\n if (responses) {\n response = ajaxHandleResponses(s, jqXHR, responses);\n }\n\n // Use a noop converter for missing script but not if jsonp\n if (!isSuccess && jQuery.inArray(\"script\", s.dataTypes) > -1 && jQuery.inArray(\"json\", s.dataTypes) < 0) {\n s.converters[\"text script\"] = function () {};\n }\n\n // Convert no matter what (that way responseXXX fields are always set)\n response = ajaxConvert(s, response, jqXHR, isSuccess);\n\n // If successful, handle type chaining\n if (isSuccess) {\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n if (s.ifModified) {\n modified = jqXHR.getResponseHeader(\"Last-Modified\");\n if (modified) {\n jQuery.lastModified[cacheURL] = modified;\n }\n modified = jqXHR.getResponseHeader(\"etag\");\n if (modified) {\n jQuery.etag[cacheURL] = modified;\n }\n }\n\n // if no content\n if (status === 204 || s.type === \"HEAD\") {\n statusText = \"nocontent\";\n\n // if not modified\n } else if (status === 304) {\n statusText = \"notmodified\";\n\n // If we have data, let's convert it\n } else {\n statusText = response.state;\n success = response.data;\n error = response.error;\n isSuccess = !error;\n }\n } else {\n // Extract error from statusText and normalize for non-aborts\n error = statusText;\n if (status || !statusText) {\n statusText = \"error\";\n if (status < 0) {\n status = 0;\n }\n }\n }\n\n // Set data for the fake xhr object\n jqXHR.status = status;\n jqXHR.statusText = (nativeStatusText || statusText) + \"\";\n\n // Success/Error\n if (isSuccess) {\n deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);\n } else {\n deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);\n }\n\n // Status-dependent callbacks\n jqXHR.statusCode(statusCode);\n statusCode = undefined;\n if (fireGlobals) {\n globalEventContext.trigger(isSuccess ? \"ajaxSuccess\" : \"ajaxError\", [jqXHR, s, isSuccess ? success : error]);\n }\n\n // Complete\n completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);\n if (fireGlobals) {\n globalEventContext.trigger(\"ajaxComplete\", [jqXHR, s]);\n\n // Handle the global AJAX counter\n if (! --jQuery.active) {\n jQuery.event.trigger(\"ajaxStop\");\n }\n }\n }\n return jqXHR;\n },\n getJSON: function (url, data, callback) {\n return jQuery.get(url, data, callback, \"json\");\n },\n getScript: function (url, callback) {\n return jQuery.get(url, undefined, callback, \"script\");\n }\n });\n jQuery.each([\"get\", \"post\"], function (_i, method) {\n jQuery[method] = function (url, data, callback, type) {\n // Shift arguments if data argument was omitted\n if (isFunction(data)) {\n type = type || callback;\n callback = data;\n data = undefined;\n }\n\n // The url can be an options object (which then must have .url)\n return jQuery.ajax(jQuery.extend({\n url: url,\n type: method,\n dataType: type,\n data: data,\n success: callback\n }, jQuery.isPlainObject(url) && url));\n };\n });\n jQuery.ajaxPrefilter(function (s) {\n var i;\n for (i in s.headers) {\n if (i.toLowerCase() === \"content-type\") {\n s.contentType = s.headers[i] || \"\";\n }\n }\n });\n jQuery._evalUrl = function (url, options, doc) {\n return jQuery.ajax({\n url: url,\n // Make this explicit, since user can override this through ajaxSetup (trac-11264)\n type: \"GET\",\n dataType: \"script\",\n cache: true,\n async: false,\n global: false,\n // Only evaluate the response if it is successful (gh-4126)\n // dataFilter is not invoked for failure responses, so using it instead\n // of the default converter is kludgy but it works.\n converters: {\n \"text script\": function () {}\n },\n dataFilter: function (response) {\n jQuery.globalEval(response, options, doc);\n }\n });\n };\n jQuery.fn.extend({\n wrapAll: function (html) {\n var wrap;\n if (this[0]) {\n if (isFunction(html)) {\n html = html.call(this[0]);\n }\n\n // The elements to wrap the target around\n wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);\n if (this[0].parentNode) {\n wrap.insertBefore(this[0]);\n }\n wrap.map(function () {\n var elem = this;\n while (elem.firstElementChild) {\n elem = elem.firstElementChild;\n }\n return elem;\n }).append(this);\n }\n return this;\n },\n wrapInner: function (html) {\n if (isFunction(html)) {\n return this.each(function (i) {\n jQuery(this).wrapInner(html.call(this, i));\n });\n }\n return this.each(function () {\n var self = jQuery(this),\n contents = self.contents();\n if (contents.length) {\n contents.wrapAll(html);\n } else {\n self.append(html);\n }\n });\n },\n wrap: function (html) {\n var htmlIsFunction = isFunction(html);\n return this.each(function (i) {\n jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);\n });\n },\n unwrap: function (selector) {\n this.parent(selector).not(\"body\").each(function () {\n jQuery(this).replaceWith(this.childNodes);\n });\n return this;\n }\n });\n jQuery.expr.pseudos.hidden = function (elem) {\n return !jQuery.expr.pseudos.visible(elem);\n };\n jQuery.expr.pseudos.visible = function (elem) {\n return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);\n };\n jQuery.ajaxSettings.xhr = function () {\n try {\n return new window.XMLHttpRequest();\n } catch (e) {}\n };\n var xhrSuccessStatus = {\n // File protocol always yields status code 0, assume 200\n 0: 200,\n // Support: IE <=9 only\n // trac-1450: sometimes IE returns 1223 when it should be 204\n 1223: 204\n },\n xhrSupported = jQuery.ajaxSettings.xhr();\n support.cors = !!xhrSupported && \"withCredentials\" in xhrSupported;\n support.ajax = xhrSupported = !!xhrSupported;\n jQuery.ajaxTransport(function (options) {\n var callback, errorCallback;\n\n // Cross domain only allowed if supported through XMLHttpRequest\n if (support.cors || xhrSupported && !options.crossDomain) {\n return {\n send: function (headers, complete) {\n var i,\n xhr = options.xhr();\n xhr.open(options.type, options.url, options.async, options.username, options.password);\n\n // Apply custom fields if provided\n if (options.xhrFields) {\n for (i in options.xhrFields) {\n xhr[i] = options.xhrFields[i];\n }\n }\n\n // Override mime type if needed\n if (options.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(options.mimeType);\n }\n\n // X-Requested-With header\n // For cross-domain requests, seeing as conditions for a preflight are\n // akin to a jigsaw puzzle, we simply never set it to be sure.\n // (it can always be set on a per-request basis or even using ajaxSetup)\n // For same-domain requests, won't change header if already provided.\n if (!options.crossDomain && !headers[\"X-Requested-With\"]) {\n headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\n }\n\n // Set headers\n for (i in headers) {\n xhr.setRequestHeader(i, headers[i]);\n }\n\n // Callback\n callback = function (type) {\n return function () {\n if (callback) {\n callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;\n if (type === \"abort\") {\n xhr.abort();\n } else if (type === \"error\") {\n // Support: IE <=9 only\n // On a manual native abort, IE9 throws\n // errors on any property access that is not readyState\n if (typeof xhr.status !== \"number\") {\n complete(0, \"error\");\n } else {\n complete(\n // File: protocol always yields status 0; see trac-8605, trac-14207\n xhr.status, xhr.statusText);\n }\n } else {\n complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText,\n // Support: IE <=9 only\n // IE9 has no XHR2 but throws on binary (trac-11426)\n // For XHR2 non-text, let the caller handle it (gh-2498)\n (xhr.responseType || \"text\") !== \"text\" || typeof xhr.responseText !== \"string\" ? {\n binary: xhr.response\n } : {\n text: xhr.responseText\n }, xhr.getAllResponseHeaders());\n }\n }\n };\n };\n\n // Listen to events\n xhr.onload = callback();\n errorCallback = xhr.onerror = xhr.ontimeout = callback(\"error\");\n\n // Support: IE 9 only\n // Use onreadystatechange to replace onabort\n // to handle uncaught aborts\n if (xhr.onabort !== undefined) {\n xhr.onabort = errorCallback;\n } else {\n xhr.onreadystatechange = function () {\n // Check readyState before timeout as it changes\n if (xhr.readyState === 4) {\n // Allow onerror to be called first,\n // but that will not handle a native abort\n // Also, save errorCallback to a variable\n // as xhr.onerror cannot be accessed\n window.setTimeout(function () {\n if (callback) {\n errorCallback();\n }\n });\n }\n };\n }\n\n // Create the abort callback\n callback = callback(\"abort\");\n try {\n // Do send the request (this may raise an exception)\n xhr.send(options.hasContent && options.data || null);\n } catch (e) {\n // trac-14683: Only rethrow if this hasn't been notified as an error yet\n if (callback) {\n throw e;\n }\n }\n },\n abort: function () {\n if (callback) {\n callback();\n }\n }\n };\n }\n });\n\n // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\n jQuery.ajaxPrefilter(function (s) {\n if (s.crossDomain) {\n s.contents.script = false;\n }\n });\n\n // Install script dataType\n jQuery.ajaxSetup({\n accepts: {\n script: \"text/javascript, application/javascript, \" + \"application/ecmascript, application/x-ecmascript\"\n },\n contents: {\n script: /\\b(?:java|ecma)script\\b/\n },\n converters: {\n \"text script\": function (text) {\n jQuery.globalEval(text);\n return text;\n }\n }\n });\n\n // Handle cache's special case and crossDomain\n jQuery.ajaxPrefilter(\"script\", function (s) {\n if (s.cache === undefined) {\n s.cache = false;\n }\n if (s.crossDomain) {\n s.type = \"GET\";\n }\n });\n\n // Bind script tag hack transport\n jQuery.ajaxTransport(\"script\", function (s) {\n // This transport only deals with cross domain or forced-by-attrs requests\n if (s.crossDomain || s.scriptAttrs) {\n var script, callback;\n return {\n send: function (_, complete) {\n script = jQuery(\"\n * \n * @example\n * AMD\n * // main.js\n * require.config({\n * paths: {\n * braintreeClient: 'https://js.braintreegateway.com/web/{@pkg version}/js/client.min'\n * }\n * });\n *\n * require(['braintreeClient'], function (braintreeClient) {\n * braintreeClient.create(...);\n * });\n */\n\n /**\n * @global\n * @callback callback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {?any} [data] The successful result of the asynchronous function call (if data exists).\n * @description The Node.js-style callback pattern used throughout the SDK.\n * @returns {void}\n */\n var americanExpress = _dereq_(\"./american-express\");\n var applePay = _dereq_(\"./apple-pay\");\n var client = _dereq_(\"./client\");\n var dataCollector = _dereq_(\"./data-collector\");\n var hostedFields = _dereq_(\"./hosted-fields\");\n var localPayment = _dereq_(\"./local-payment\");\n var masterpass = _dereq_(\"./masterpass\");\n var paymentRequest = _dereq_(\"./payment-request\");\n var paypal = _dereq_(\"./paypal\");\n var paypalCheckout = _dereq_(\"./paypal-checkout\");\n var googlePayment = _dereq_(\"./google-payment\");\n var sepa = _dereq_(\"./sepa\");\n var threeDSecure = _dereq_(\"./three-d-secure\");\n var unionpay = _dereq_(\"./unionpay\");\n var usBankAccount = _dereq_(\"./us-bank-account\");\n var vaultManager = _dereq_(\"./vault-manager\");\n var venmo = _dereq_(\"./venmo\");\n var visaCheckout = _dereq_(\"./visa-checkout\");\n var preferredPaymentMethods = _dereq_(\"./preferred-payment-methods\");\n var VERSION = \"3.101.1\";\n module.exports = {\n /** @type {module:braintree-web/american-express} */\n americanExpress: americanExpress,\n /** @type {module:braintree-web/apple-pay} */\n applePay: applePay,\n /** @type {module:braintree-web/client} */\n client: client,\n /** @type {module:braintree-web/data-collector} */\n dataCollector: dataCollector,\n /** @type {module:braintree-web/hosted-fields} */\n hostedFields: hostedFields,\n /** @type {module:braintree-web/local-payment} */\n localPayment: localPayment,\n /** @type {module:braintree-web/masterpass} */\n masterpass: masterpass,\n /** @type {module:braintree-web/google-payment} */\n googlePayment: googlePayment,\n /** @type {module:braintree-web/payment-request} */\n paymentRequest: paymentRequest,\n /** @type {module:braintree-web/paypal} */\n paypal: paypal,\n /** @type {module:braintree-web/paypal-checkout} */\n paypalCheckout: paypalCheckout,\n /** @type {module:braintree-web/three-d-secure} */\n threeDSecure: threeDSecure,\n /** @type {module:braintree-web/unionpay} */\n unionpay: unionpay,\n /** @type {module:braintree-web/us-bank-account} */\n usBankAccount: usBankAccount,\n /** @type {module:braintree-web/vault-manager} */\n vaultManager: vaultManager,\n /** @type {module:braintree-web/venmo} */\n venmo: venmo,\n /** @type {module:braintree-web/visa-checkout} */\n visaCheckout: visaCheckout,\n /** @type {module:braintree-web/sepa} */\n sepa: sepa,\n /** @type {module:braintree-web/preferred-payment-methods} */\n preferredPaymentMethods: preferredPaymentMethods,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"./american-express\": 74,\n \"./apple-pay\": 77,\n \"./client\": 82,\n \"./data-collector\": 98,\n \"./google-payment\": 103,\n \"./hosted-fields\": 110,\n \"./local-payment\": 164,\n \"./masterpass\": 167,\n \"./payment-request\": 172,\n \"./paypal\": 179,\n \"./paypal-checkout\": 176,\n \"./preferred-payment-methods\": 182,\n \"./sepa\": 186,\n \"./three-d-secure\": 198,\n \"./unionpay\": 202,\n \"./us-bank-account\": 208,\n \"./vault-manager\": 211,\n \"./venmo\": 216,\n \"./visa-checkout\": 226\n }],\n 118: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var createAuthorizationData = _dereq_(\"./create-authorization-data\");\n var jsonClone = _dereq_(\"./json-clone\");\n var constants = _dereq_(\"./constants\");\n function addMetadata(configuration, data) {\n var key;\n var attrs = data ? jsonClone(data) : {};\n var authAttrs = createAuthorizationData(configuration.authorization).attrs;\n var _meta = jsonClone(configuration.analyticsMetadata);\n attrs.braintreeLibraryVersion = constants.BRAINTREE_LIBRARY_VERSION;\n for (key in attrs._meta) {\n if (attrs._meta.hasOwnProperty(key)) {\n _meta[key] = attrs._meta[key];\n }\n }\n attrs._meta = _meta;\n if (authAttrs.tokenizationKey) {\n attrs.tokenizationKey = authAttrs.tokenizationKey;\n } else {\n attrs.authorizationFingerprint = authAttrs.authorizationFingerprint;\n }\n return attrs;\n }\n module.exports = addMetadata;\n }, {\n \"./constants\": 126,\n \"./create-authorization-data\": 130,\n \"./json-clone\": 154\n }],\n 119: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var constants = _dereq_(\"./constants\");\n var addMetadata = _dereq_(\"./add-metadata\");\n function sendAnalyticsEvent(clientInstanceOrPromise, kind, callback) {\n var timestamp = Date.now(); // milliseconds\n\n return Promise.resolve(clientInstanceOrPromise).then(function (client) {\n var timestampInPromise = Date.now();\n var configuration = client.getConfiguration();\n var request = client._request;\n var url = configuration.gatewayConfiguration.analytics.url;\n var data = {\n analytics: [{\n kind: constants.ANALYTICS_PREFIX + kind,\n isAsync: Math.floor(timestampInPromise / 1000) !== Math.floor(timestamp / 1000),\n timestamp: timestamp\n }]\n };\n request({\n url: url,\n method: \"post\",\n data: addMetadata(configuration, data),\n timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS\n }, callback);\n }).catch(function (err) {\n // for all non-test cases, we don't provide a callback,\n // so this error will always be swallowed. In this case,\n // that's fine, it should only error when the deferred\n // client fails to set up, in which case we don't want\n // that error to report over and over again via these\n // deferred analytics events\n if (callback) {\n callback(err);\n }\n });\n }\n module.exports = {\n sendEvent: sendAnalyticsEvent\n };\n }, {\n \"./add-metadata\": 118,\n \"./constants\": 126\n }],\n 120: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var loadScript = _dereq_(\"@braintree/asset-loader/load-script\");\n module.exports = {\n loadScript: loadScript\n };\n }, {\n \"@braintree/asset-loader/load-script\": 3\n }],\n 121: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var assignNormalized = typeof Object.assign === \"function\" ? Object.assign : assignPolyfill;\n function assignPolyfill(destination) {\n var i, source, key;\n for (i = 1; i < arguments.length; i++) {\n source = arguments[i];\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n }\n return destination;\n }\n module.exports = {\n assign: assignNormalized,\n _assign: assignPolyfill\n };\n }, {}],\n 122: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"./braintree-error\");\n var sharedErrors = _dereq_(\"./errors\");\n var VERSION = \"3.101.1\";\n function basicComponentVerification(options) {\n var client, authorization, name;\n if (!options) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.type,\n code: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.code,\n message: \"Options must be passed to basicComponentVerification function.\"\n }));\n }\n name = options.name;\n client = options.client;\n authorization = options.authorization;\n if (!client && !authorization) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n // NEXT_MAJOR_VERSION in major version, we expose passing in authorization for all components\n // instead of passing in a client instance. Leave this a silent feature for now.\n message: \"options.client is required when instantiating \" + name + \".\"\n }));\n }\n if (!authorization && client.getVersion() !== VERSION) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message: \"Client (version \" + client.getVersion() + \") and \" + name + \" (version \" + VERSION + \") components must be from the same SDK version.\"\n }));\n }\n return Promise.resolve();\n }\n module.exports = {\n verify: basicComponentVerification\n };\n }, {\n \"./braintree-error\": 124,\n \"./errors\": 135\n }],\n 123: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var once = _dereq_(\"./once\");\n function call(fn, callback) {\n var isSync = fn.length === 0;\n if (isSync) {\n fn();\n callback(null);\n } else {\n fn(callback);\n }\n }\n module.exports = function (functions, cb) {\n var i;\n var length = functions.length;\n var remaining = length;\n var callback = once(cb);\n if (length === 0) {\n callback(null);\n return;\n }\n function finish(err) {\n if (err) {\n callback(err);\n return;\n }\n remaining -= 1;\n if (remaining === 0) {\n callback(null);\n }\n }\n for (i = 0; i < length; i++) {\n call(functions[i], finish);\n }\n };\n }, {\n \"./once\": 156\n }],\n 124: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var enumerate = _dereq_(\"./enumerate\");\n\n /**\n * @class\n * @global\n * @param {object} options Construction options\n * @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.\n * @description You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.\n */\n function BraintreeError(options) {\n if (!BraintreeError.types.hasOwnProperty(options.type)) {\n throw new Error(options.type + \" is not a valid type.\");\n }\n if (!options.code) {\n throw new Error(\"Error code required.\");\n }\n if (!options.message) {\n throw new Error(\"Error message required.\");\n }\n this.name = \"BraintreeError\";\n\n /**\n * @type {string}\n * @description A code that corresponds to specific errors.\n */\n this.code = options.code;\n\n /**\n * @type {string}\n * @description A short description of the error.\n */\n this.message = options.message;\n\n /**\n * @type {BraintreeError.types}\n * @description The type of error.\n */\n this.type = options.type;\n\n /**\n * @type {object=}\n * @description Additional information about the error, such as an underlying network error response.\n */\n this.details = options.details;\n }\n BraintreeError.prototype = Object.create(Error.prototype);\n BraintreeError.prototype.constructor = BraintreeError;\n\n /**\n * Enum for {@link BraintreeError} types.\n * @name BraintreeError.types\n * @enum\n * @readonly\n * @memberof BraintreeError\n * @property {string} CUSTOMER An error caused by the customer.\n * @property {string} MERCHANT An error that is actionable by the merchant.\n * @property {string} NETWORK An error due to a network problem.\n * @property {string} INTERNAL An error caused by Braintree code.\n * @property {string} UNKNOWN An error where the origin is unknown.\n */\n BraintreeError.types = enumerate([\"CUSTOMER\", \"MERCHANT\", \"NETWORK\", \"INTERNAL\", \"UNKNOWN\"]);\n BraintreeError.findRootError = function (err) {\n if (err instanceof BraintreeError && err.details && err.details.originalError) {\n return BraintreeError.findRootError(err.details.originalError);\n }\n return err;\n };\n module.exports = BraintreeError;\n }, {\n \"./enumerate\": 134\n }],\n 125: [function (_dereq_, module, exports) {\n \"use strict\";\n\n // Taken from https://github.com/sindresorhus/decamelize/blob/95980ab6fb44c40eaca7792bdf93aff7c210c805/index.js\n function transformKey(key) {\n return key.replace(/([a-z\\d])([A-Z])/g, \"$1_$2\").replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, \"$1_$2\").toLowerCase();\n }\n module.exports = function (obj) {\n return Object.keys(obj).reduce(function (newObj, key) {\n var transformedKey = transformKey(key);\n newObj[transformedKey] = obj[key];\n return newObj;\n }, {});\n };\n }, {}],\n 126: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var VERSION = \"3.101.1\";\n var PLATFORM = \"web\";\n var CLIENT_API_URLS = {\n production: \"https://api.braintreegateway.com:443\",\n sandbox: \"https://api.sandbox.braintreegateway.com:443\"\n };\n var ASSETS_URLS = {\n production: \"https://assets.braintreegateway.com\",\n sandbox: \"https://assets.braintreegateway.com\"\n };\n var GRAPHQL_URLS = {\n production: \"https://payments.braintree-api.com/graphql\",\n sandbox: \"https://payments.sandbox.braintree-api.com/graphql\"\n };\n\n // endRemoveIf(production)\n\n module.exports = {\n ANALYTICS_PREFIX: PLATFORM + \".\",\n ANALYTICS_REQUEST_TIMEOUT_MS: 2000,\n ASSETS_URLS: ASSETS_URLS,\n CLIENT_API_URLS: CLIENT_API_URLS,\n FRAUDNET_SOURCE: \"BRAINTREE_SIGNIN\",\n FRAUDNET_FNCLS: \"fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99\",\n FRAUDNET_URL: \"https://c.paypal.com/da/r/fb.js\",\n BUS_CONFIGURATION_REQUEST_EVENT: \"BUS_CONFIGURATION_REQUEST\",\n GRAPHQL_URLS: GRAPHQL_URLS,\n INTEGRATION_TIMEOUT_MS: 60000,\n VERSION: VERSION,\n INTEGRATION: \"custom\",\n SOURCE: \"client\",\n PLATFORM: PLATFORM,\n BRAINTREE_LIBRARY_VERSION: \"braintree/\" + PLATFORM + \"/\" + VERSION\n };\n }, {}],\n 127: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"./braintree-error\");\n var sharedErrors = _dereq_(\"./errors\");\n module.exports = function (instance, methodNames) {\n methodNames.forEach(function (methodName) {\n instance[methodName] = function () {\n throw new BraintreeError({\n type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,\n code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,\n message: methodName + \" cannot be called after teardown.\"\n });\n };\n });\n };\n }, {\n \"./braintree-error\": 124,\n \"./errors\": 135\n }],\n 128: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"./braintree-error\");\n function convertToBraintreeError(originalErr, btErrorObject) {\n if (originalErr instanceof BraintreeError) {\n return originalErr;\n }\n return new BraintreeError({\n type: btErrorObject.type,\n code: btErrorObject.code,\n message: btErrorObject.message,\n details: {\n originalError: originalErr\n }\n });\n }\n module.exports = convertToBraintreeError;\n }, {\n \"./braintree-error\": 124\n }],\n 129: [function (_dereq_, module, exports) {\n \"use strict\";\n\n // endRemoveIf(production)\n var ASSETS_URLS = _dereq_(\"./constants\").ASSETS_URLS;\n function createAssetsUrl(authorization) {\n // endRemoveIf(production)\n\n return ASSETS_URLS.production;\n }\n /* eslint-enable */\n\n module.exports = {\n create: createAssetsUrl\n };\n }, {\n \"./constants\": 126\n }],\n 130: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var atob = _dereq_(\"../lib/vendor/polyfill\").atob;\n var CLIENT_API_URLS = _dereq_(\"../lib/constants\").CLIENT_API_URLS;\n function _isTokenizationKey(str) {\n return /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(str);\n }\n function _parseTokenizationKey(tokenizationKey) {\n var tokens = tokenizationKey.split(\"_\");\n var environment = tokens[0];\n var merchantId = tokens.slice(2).join(\"_\");\n return {\n merchantId: merchantId,\n environment: environment\n };\n }\n function createAuthorizationData(authorization) {\n var parsedClientToken, parsedTokenizationKey;\n var data = {\n attrs: {},\n configUrl: \"\"\n };\n if (_isTokenizationKey(authorization)) {\n parsedTokenizationKey = _parseTokenizationKey(authorization);\n data.environment = parsedTokenizationKey.environment;\n data.attrs.tokenizationKey = authorization;\n data.configUrl = CLIENT_API_URLS[parsedTokenizationKey.environment] + \"/merchants/\" + parsedTokenizationKey.merchantId + \"/client_api/v1/configuration\";\n } else {\n parsedClientToken = JSON.parse(atob(authorization));\n data.environment = parsedClientToken.environment;\n data.attrs.authorizationFingerprint = parsedClientToken.authorizationFingerprint;\n data.configUrl = parsedClientToken.configUrl;\n data.graphQL = parsedClientToken.graphQL;\n }\n return data;\n }\n module.exports = createAuthorizationData;\n }, {\n \"../lib/constants\": 126,\n \"../lib/vendor/polyfill\": 161\n }],\n 131: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"./braintree-error\");\n var assets = _dereq_(\"./assets\");\n var sharedErrors = _dereq_(\"./errors\");\n var VERSION = \"3.101.1\";\n function createDeferredClient(options) {\n var promise = Promise.resolve();\n if (options.client) {\n return Promise.resolve(options.client);\n }\n if (!(window.braintree && window.braintree.client)) {\n promise = assets.loadScript({\n src: options.assetsUrl + \"/web/\" + VERSION + \"/js/client.min.js\"\n }).catch(function (err) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.type,\n code: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.code,\n message: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.message,\n details: {\n originalError: err\n }\n }));\n });\n }\n return promise.then(function () {\n if (window.braintree.client.VERSION !== VERSION) {\n return Promise.reject(new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message: \"Client (version \" + window.braintree.client.VERSION + \") and \" + options.name + \" (version \" + VERSION + \") components must be from the same SDK version.\"\n }));\n }\n return window.braintree.client.create({\n authorization: options.authorization,\n debug: options.debug\n });\n });\n }\n module.exports = {\n create: createDeferredClient\n };\n }, {\n \"./assets\": 120,\n \"./braintree-error\": 124,\n \"./errors\": 135\n }],\n 132: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (fn) {\n return function () {\n // IE9 doesn't support passing arguments to setTimeout so we have to emulate it.\n var args = arguments;\n setTimeout(function () {\n fn.apply(null, args);\n }, 1);\n };\n };\n }, {}],\n 133: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var batchExecuteFunctions = _dereq_(\"./batch-execute-functions\");\n function Destructor() {\n this._teardownRegistry = [];\n this._isTearingDown = false;\n }\n Destructor.prototype.registerFunctionForTeardown = function (fn) {\n if (typeof fn === \"function\") {\n this._teardownRegistry.push(fn);\n }\n };\n Destructor.prototype.teardown = function (callback) {\n if (this._isTearingDown) {\n callback(new Error(\"Destructor is already tearing down\"));\n return;\n }\n this._isTearingDown = true;\n batchExecuteFunctions(this._teardownRegistry, function (err) {\n this._teardownRegistry = [];\n this._isTearingDown = false;\n if (typeof callback === \"function\") {\n callback(err);\n }\n }.bind(this));\n };\n module.exports = Destructor;\n }, {\n \"./batch-execute-functions\": 123\n }],\n 134: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function enumerate(values, prefix) {\n prefix = prefix == null ? \"\" : prefix;\n return values.reduce(function (enumeration, value) {\n enumeration[value] = prefix + value;\n return enumeration;\n }, {});\n }\n module.exports = enumerate;\n }, {}],\n 135: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Shared Internal Error Codes\n * @ignore\n * @description These codes should never be experienced by the merchant directly.\n * @property {INTERNAL} INVALID_USE_OF_INTERNAL_FUNCTION Occurs when the client is created without a gateway configuration. Should never happen.\n */\n\n /**\n * @name BraintreeError.Shared Errors - Component Creation Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} INSTANTIATION_OPTION_REQUIRED Occurs when a component is created that is missing a required option.\n * @property {MERCHANT} INCOMPATIBLE_VERSIONS Occurs when a component is created with a client with a different version than the component.\n * @property {NETWORK} CLIENT_SCRIPT_FAILED_TO_LOAD Occurs when a component attempts to load the Braintree client script, but the request fails.\n */\n\n /**\n * @name BraintreeError.Shared Errors - Component Instance Error Codes\n * @description Errors that occur when using instances of components.\n * @property {MERCHANT} METHOD_CALLED_AFTER_TEARDOWN Occurs when a method is called on a component instance after it has been torn down.\n */\n var BraintreeError = _dereq_(\"./braintree-error\");\n module.exports = {\n INVALID_USE_OF_INTERNAL_FUNCTION: {\n type: BraintreeError.types.INTERNAL,\n code: \"INVALID_USE_OF_INTERNAL_FUNCTION\"\n },\n INSTANTIATION_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"INSTANTIATION_OPTION_REQUIRED\"\n },\n INCOMPATIBLE_VERSIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"INCOMPATIBLE_VERSIONS\"\n },\n CLIENT_SCRIPT_FAILED_TO_LOAD: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_SCRIPT_FAILED_TO_LOAD\",\n message: \"Braintree client script could not be loaded.\"\n },\n METHOD_CALLED_AFTER_TEARDOWN: {\n type: BraintreeError.types.MERCHANT,\n code: \"METHOD_CALLED_AFTER_TEARDOWN\"\n }\n };\n }, {\n \"./braintree-error\": 124\n }],\n 136: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function findRootNode(element) {\n while (element.parentNode) {\n element = element.parentNode;\n }\n return element;\n };\n }, {}],\n 137: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (array, key, value) {\n var i;\n for (i = 0; i < array.length; i++) {\n if (array[i].hasOwnProperty(key) && array[i][key] === value) {\n return array[i];\n }\n }\n return null;\n };\n }, {}],\n 138: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var Popup = _dereq_(\"./strategies/popup\");\n var PopupBridge = _dereq_(\"./strategies/popup-bridge\");\n var Modal = _dereq_(\"./strategies/modal\");\n var Bus = _dereq_(\"framebus\");\n var events = _dereq_(\"../shared/events\");\n var errors = _dereq_(\"../shared/errors\");\n var constants = _dereq_(\"../shared/constants\");\n var uuid = _dereq_(\"@braintree/uuid\");\n var iFramer = _dereq_(\"@braintree/iframer\");\n var BraintreeError = _dereq_(\"../../braintree-error\");\n var browserDetection = _dereq_(\"../shared/browser-detection\");\n var assign = _dereq_(\"./../../assign\").assign;\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_(\"../../constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n var REQUIRED_CONFIG_KEYS = [\"name\", \"dispatchFrameUrl\", \"openFrameUrl\"];\n function noop() {}\n function _validateFrameConfiguration(options) {\n if (!options) {\n throw new Error(\"Valid configuration is required\");\n }\n REQUIRED_CONFIG_KEYS.forEach(function (key) {\n if (!options.hasOwnProperty(key)) {\n throw new Error(\"A valid frame \" + key + \" must be provided\");\n }\n });\n if (!/^[\\w_]+$/.test(options.name)) {\n throw new Error(\"A valid frame name must be provided\");\n }\n }\n function FrameService(options) {\n _validateFrameConfiguration(options);\n this._serviceId = uuid().replace(/-/g, \"\");\n this._options = {\n name: options.name + \"_\" + this._serviceId,\n dispatchFrameUrl: options.dispatchFrameUrl,\n openFrameUrl: options.openFrameUrl,\n height: options.height,\n width: options.width,\n top: options.top,\n left: options.left\n };\n this.state = options.state || {};\n this._bus = new Bus({\n channel: this._serviceId\n });\n this._setBusEvents();\n }\n FrameService.prototype.initialize = function (callback) {\n var dispatchFrameReadyHandler = function () {\n callback();\n this._bus.off(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n }.bind(this);\n this._bus.on(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n this._writeDispatchFrame();\n };\n FrameService.prototype._writeDispatchFrame = function () {\n var frameName = constants.DISPATCH_FRAME_NAME + \"_\" + this._serviceId;\n var frameSrc = this._options.dispatchFrameUrl;\n this._dispatchFrame = iFramer({\n \"aria-hidden\": true,\n name: frameName,\n title: frameName,\n src: frameSrc,\n class: constants.DISPATCH_FRAME_CLASS,\n height: 0,\n width: 0,\n style: {\n position: \"absolute\",\n left: \"-9999px\"\n }\n });\n document.body.appendChild(this._dispatchFrame);\n };\n FrameService.prototype._setBusEvents = function () {\n this._bus.on(events.DISPATCH_FRAME_REPORT, function (res, reply) {\n if (this._onCompleteCallback) {\n this._onCompleteCallback.call(null, res.err, res.payload);\n }\n this._frame.close();\n this._onCompleteCallback = null;\n if (reply) {\n reply();\n }\n }.bind(this));\n this._bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply(this.state);\n }.bind(this));\n };\n FrameService.prototype.open = function (options, callback) {\n options = options || {};\n this._frame = this._getFrameForEnvironment(options);\n this._frame.initialize(callback);\n if (this._frame instanceof PopupBridge) {\n // Frameservice loads a spinner then redirects to the final destination url.\n // For Popupbridge it doesn't have the same rules around popups since it's deferred to the mobile side\n // therefore, skips the regular open path and instead uses `#redirect` to handle things\n return;\n }\n assign(this.state, options.state);\n this._onCompleteCallback = callback;\n this._frame.open();\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n if (callback) {\n callback(new BraintreeError(errors.FRAME_SERVICE_FRAME_OPEN_FAILED));\n }\n return;\n }\n this._pollForPopupClose();\n };\n FrameService.prototype.redirect = function (url) {\n if (this._frame && !this.isFrameClosed()) {\n this._frame.redirect(url);\n }\n };\n FrameService.prototype.close = function () {\n if (!this.isFrameClosed()) {\n this._frame.close();\n }\n };\n FrameService.prototype.focus = function () {\n if (!this.isFrameClosed()) {\n this._frame.focus();\n }\n };\n FrameService.prototype.createHandler = function (options) {\n options = options || {};\n return {\n close: function () {\n if (options.beforeClose) {\n options.beforeClose();\n }\n this.close();\n }.bind(this),\n focus: function () {\n if (options.beforeFocus) {\n options.beforeFocus();\n }\n this.focus();\n }.bind(this)\n };\n };\n FrameService.prototype.createNoopHandler = function () {\n return {\n close: noop,\n focus: noop\n };\n };\n FrameService.prototype.teardown = function () {\n this.close();\n this._dispatchFrame.parentNode.removeChild(this._dispatchFrame);\n this._dispatchFrame = null;\n this._cleanupFrame();\n };\n FrameService.prototype.isFrameClosed = function () {\n return this._frame == null || this._frame.isClosed();\n };\n FrameService.prototype._cleanupFrame = function () {\n this._frame = null;\n clearInterval(this._popupInterval);\n this._popupInterval = null;\n };\n FrameService.prototype._pollForPopupClose = function () {\n this._popupInterval = setInterval(function () {\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n if (this._onCompleteCallback) {\n this._onCompleteCallback(new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED));\n }\n }\n }.bind(this), constants.POPUP_POLL_INTERVAL);\n return this._popupInterval;\n };\n FrameService.prototype._getFrameForEnvironment = function (options) {\n var usePopup = browserDetection.supportsPopups();\n var popupBridgeExists = Boolean(window.popupBridge);\n var initOptions = assign({}, this._options, options);\n if (popupBridgeExists) {\n return new PopupBridge(initOptions);\n } else if (usePopup) {\n return new Popup(initOptions);\n }\n return new Modal(initOptions);\n };\n module.exports = FrameService;\n }, {\n \"../../braintree-error\": 124,\n \"../../constants\": 126,\n \"../shared/browser-detection\": 145,\n \"../shared/constants\": 146,\n \"../shared/errors\": 147,\n \"../shared/events\": 148,\n \"./../../assign\": 121,\n \"./strategies/modal\": 140,\n \"./strategies/popup\": 143,\n \"./strategies/popup-bridge\": 141,\n \"@braintree/iframer\": 35,\n \"@braintree/uuid\": 39,\n \"framebus\": 52\n }],\n 139: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var FrameService = _dereq_(\"./frame-service\");\n\n /**\n * @ignore\n * @function create\n * Initializing FrameService should be done at the point when the component is created, so it is ready whenever a component needs to open a popup window.\n * Browsers have varying rules around what constitutes and async action worth blocking a popup for, but the likes of Safari\n * will block the popup if `frameService#create` is invoked during any asynchronous process (such as an API request to tokenize payment details).\n *\n * The process of setting up the dispatch frame and subsequent framebus communications via event listeners are considered async by Safari's standards.\n *\n * @param {object} options The options provided to frameservice\n * @param {string} options.name The name to use for identifying the various pieces associated with frameservice.\n * @param {string} options.dispatchFrameUrl The static asset to load for use as the dispatch frame. This allows for secure communication between the iframe and the popup, since they are on the same asset domain (usually checkout.paypal.com or assets.braintreegateway.com)\n * @param {string} options.openFrameUrl The url to load in the popup. Sometimes it is the case that you'll need info that comes _after_ the popup loads in which case we load the `landing-frame` that's a loading spinner then redirect to the proper/final destination. See the PayPal component for an example.\n * Otherwise if all the info needed is ready up-front, then you can forego a landing frame and go straight to the final destination.\n * @param {string} [options.height] The desired popup height.\n * @param {string} [options.width] The desired popup width.\n * @param {string} [options.top] The desired top value of the popup for positioning.\n * @param {string} [options.left] The desired left value of the popup for positioning.\n * @param {object} [options.state] Seems to be dead code, but allows for injecting data in to popup. NEXT_MAJOR_VERSION remove this param if no usage exists.\n * @param {function} callback The function to invoke once the frameservice is created and ready to use. FrameService instance is returned.\n */\n module.exports = {\n create: function createFrameService(options, callback) {\n var frameService = new FrameService(options);\n frameService.initialize(function () {\n callback(frameService);\n });\n }\n };\n }, {\n \"./frame-service\": 138\n }],\n 140: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var iFramer = _dereq_(\"@braintree/iframer\");\n var assign = _dereq_(\"../../../assign\").assign;\n var browserDetection = _dereq_(\"../../shared/browser-detection\");\n var ELEMENT_STYLES = {\n position: \"fixed\",\n top: 0,\n left: 0,\n bottom: 0,\n padding: 0,\n margin: 0,\n border: 0,\n outline: \"none\",\n zIndex: 20001,\n background: \"#FFFFFF\"\n };\n function noop() {}\n\n /**\n *\n * We should not ever really use the Modal. Modals are _like_ popups, but the key difference is that the customer can't actually verify it's app domain and thus secure/valid. Old PP sdk (./src/paypal) uses this\n * to get info from webviews (e.g. facebook).\n */\n\n function Modal(options) {\n this._closed = null;\n this._frame = null;\n this._options = options || {};\n this._container = this._options.container || document.body;\n }\n Modal.prototype.initialize = noop;\n Modal.prototype.open = function () {\n var iframerConfig = {\n src: this._options.openFrameUrl,\n name: this._options.name,\n scrolling: \"yes\",\n height: \"100%\",\n width: \"100%\",\n style: assign({}, ELEMENT_STYLES),\n title: \"Lightbox Frame\"\n };\n if (browserDetection.isIos()) {\n // WKWebView has buggy behavior when scrolling a fixed position modal. The workaround is to lock scrolling in\n // the background. When modal is closed, we restore scrolling and return to the previous scroll position.\n if (browserDetection.isIosWKWebview()) {\n this._lockScrolling();\n // Allows WKWebView to scroll all the way down to bottom\n iframerConfig.style = {};\n }\n this._el = document.createElement(\"div\");\n assign(this._el.style, ELEMENT_STYLES, {\n height: \"100%\",\n width: \"100%\",\n overflow: \"auto\",\n \"-webkit-overflow-scrolling\": \"touch\"\n });\n this._frame = iFramer(iframerConfig);\n this._el.appendChild(this._frame);\n } else {\n this._el = this._frame = iFramer(iframerConfig);\n }\n this._closed = false;\n this._container.appendChild(this._el);\n };\n Modal.prototype.focus = noop;\n Modal.prototype.close = function () {\n this._container.removeChild(this._el);\n this._frame = null;\n this._closed = true;\n if (browserDetection.isIosWKWebview()) {\n this._unlockScrolling();\n }\n };\n Modal.prototype.isClosed = function () {\n return Boolean(this._closed);\n };\n Modal.prototype.redirect = function (redirectUrl) {\n this._frame.src = redirectUrl;\n };\n Modal.prototype._unlockScrolling = function () {\n document.body.style.overflow = this._savedBodyProperties.overflowStyle;\n document.body.style.position = this._savedBodyProperties.positionStyle;\n window.scrollTo(this._savedBodyProperties.left, this._savedBodyProperties.top);\n delete this._savedBodyProperties;\n };\n Modal.prototype._lockScrolling = function () {\n var doc = document.documentElement;\n\n // From https://stackoverflow.com/questions/9538868/prevent-body-from-scrolling-when-a-modal-is-opened#comment65626743_24727206\n this._savedBodyProperties = {\n left: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),\n top: (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0),\n overflowStyle: document.body.style.overflow,\n positionStyle: document.body.style.position\n };\n document.body.style.overflow = \"hidden\";\n document.body.style.position = \"fixed\";\n window.scrollTo(0, 0);\n };\n module.exports = Modal;\n }, {\n \"../../../assign\": 121,\n \"../../shared/browser-detection\": 145,\n \"@braintree/iframer\": 35\n }],\n 141: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"../../../braintree-error\");\n var errors = _dereq_(\"../../shared/errors\");\n function noop() {}\n function PopupBridge(options) {\n this._closed = null;\n this._options = options;\n }\n PopupBridge.prototype.initialize = function (callback) {\n var self = this;\n window.popupBridge.onComplete = function (err, payload) {\n var popupDismissed = !payload && !err;\n self._closed = true;\n if (err || popupDismissed) {\n // User clicked \"Done\" button of browser view\n callback(new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED));\n return;\n }\n // User completed popup flow (includes success and cancel cases)\n callback(null, payload);\n };\n };\n PopupBridge.prototype.open = function (options) {\n var url;\n options = options || {};\n url = options.openFrameUrl || this._options.openFrameUrl;\n this._closed = false;\n window.popupBridge.open(url);\n };\n PopupBridge.prototype.focus = noop;\n PopupBridge.prototype.close = noop;\n PopupBridge.prototype.isClosed = function () {\n return Boolean(this._closed);\n };\n PopupBridge.prototype.redirect = function (redirectUrl) {\n this.open({\n openFrameUrl: redirectUrl\n });\n };\n module.exports = PopupBridge;\n }, {\n \"../../../braintree-error\": 124,\n \"../../shared/errors\": 147\n }],\n 142: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var constants = _dereq_(\"../../../shared/constants\");\n var position = _dereq_(\"./position\");\n function calculatePosition(type, userDefinedPosition, size) {\n if (typeof userDefinedPosition !== \"undefined\") {\n return userDefinedPosition;\n }\n return position[type](size);\n }\n module.exports = function composePopupOptions(options) {\n var height = options.height || constants.DEFAULT_POPUP_HEIGHT;\n var width = options.width || constants.DEFAULT_POPUP_WIDTH;\n var top = calculatePosition(\"top\", options.top, height);\n var left = calculatePosition(\"left\", options.left, width);\n return [constants.POPUP_BASE_OPTIONS, \"height=\" + height, \"width=\" + width, \"top=\" + top, \"left=\" + left].join(\",\");\n };\n }, {\n \"../../../shared/constants\": 146,\n \"./position\": 144\n }],\n 143: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var composeOptions = _dereq_(\"./compose-options\");\n function noop() {}\n function Popup(options) {\n this._frame = null;\n this._options = options || {};\n }\n Popup.prototype.initialize = noop;\n Popup.prototype.open = function () {\n this._frame = window.open(this._options.openFrameUrl, this._options.name, composeOptions(this._options));\n };\n Popup.prototype.focus = function () {\n this._frame.focus();\n };\n Popup.prototype.close = function () {\n if (this._frame.closed) {\n return;\n }\n this._frame.close();\n };\n Popup.prototype.isClosed = function () {\n return !this._frame || Boolean(this._frame.closed);\n };\n Popup.prototype.redirect = function (redirectUrl) {\n this._frame.location.href = redirectUrl;\n };\n module.exports = Popup;\n }, {\n \"./compose-options\": 142\n }],\n 144: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function top(height) {\n var windowHeight = window.outerHeight || document.documentElement.clientHeight;\n var windowTop = window.screenY == null ? window.screenTop : window.screenY;\n return center(windowHeight, height, windowTop);\n }\n function left(width) {\n var windowWidth = window.outerWidth || document.documentElement.clientWidth;\n var windowLeft = window.screenX == null ? window.screenLeft : window.screenX;\n return center(windowWidth, width, windowLeft);\n }\n function center(windowMetric, popupMetric, offset) {\n return (windowMetric - popupMetric) / 2 + offset;\n }\n module.exports = {\n top: top,\n left: left,\n center: center\n };\n }, {}],\n 145: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n isIos: _dereq_(\"@braintree/browser-detection/is-ios\"),\n isIosWKWebview: _dereq_(\"@braintree/browser-detection/is-ios-wkwebview\"),\n supportsPopups: _dereq_(\"@braintree/browser-detection/supports-popups\")\n };\n }, {\n \"@braintree/browser-detection/is-ios\": 30,\n \"@braintree/browser-detection/is-ios-wkwebview\": 29,\n \"@braintree/browser-detection/supports-popups\": 32\n }],\n 146: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n DISPATCH_FRAME_NAME: \"dispatch\",\n DISPATCH_FRAME_CLASS: \"braintree-dispatch-frame\",\n POPUP_BASE_OPTIONS: \"resizable,scrollbars\",\n DEFAULT_POPUP_WIDTH: 450,\n DEFAULT_POPUP_HEIGHT: 535,\n POPUP_POLL_INTERVAL: 100,\n POPUP_CLOSE_TIMEOUT: 100\n };\n }, {}],\n 147: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Popup Related Error Codes\n * @ignore\n * @description Errors that occur when using a component that opens a popup window.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_CLOSED - Occurs when the frame is closed before tokenization can occur.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_OPEN_FAILED - Occurs when the popup could not be opened.\n */\n var BraintreeError = _dereq_(\"../../braintree-error\");\n module.exports = {\n FRAME_SERVICE_FRAME_CLOSED: {\n type: BraintreeError.types.INTERNAL,\n code: \"FRAME_SERVICE_FRAME_CLOSED\",\n message: \"Frame closed before tokenization could occur.\"\n },\n FRAME_SERVICE_FRAME_OPEN_FAILED: {\n type: BraintreeError.types.INTERNAL,\n code: \"FRAME_SERVICE_FRAME_OPEN_FAILED\",\n message: \"Frame failed to open.\"\n }\n };\n }, {\n \"../../braintree-error\": 124\n }],\n 148: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var enumerate = _dereq_(\"../../enumerate\");\n module.exports = enumerate([\"DISPATCH_FRAME_READY\", \"DISPATCH_FRAME_REPORT\"], \"frameService:\");\n }, {\n \"../../enumerate\": 134\n }],\n 149: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var VERSION = \"3.101.1\";\n var assign = _dereq_(\"./assign\").assign;\n function generateTokenizationParameters(configuration, overrides) {\n var metadata = configuration.analyticsMetadata;\n var basicTokenizationParameters = {\n gateway: \"braintree\",\n \"braintree:merchantId\": configuration.gatewayConfiguration.merchantId,\n \"braintree:apiVersion\": \"v1\",\n \"braintree:sdkVersion\": VERSION,\n \"braintree:metadata\": JSON.stringify({\n source: metadata.source,\n integration: metadata.integration,\n sessionId: metadata.sessionId,\n version: VERSION,\n platform: metadata.platform\n })\n };\n return assign({}, basicTokenizationParameters, overrides);\n }\n module.exports = function (configuration, googlePayVersion, googleMerchantId) {\n var data, paypalPaymentMethod;\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var environment = configuration.gatewayConfiguration.environment === \"production\" ? \"PRODUCTION\" : \"TEST\";\n if (googlePayVersion === 2) {\n data = {\n apiVersion: 2,\n apiVersionMinor: 0,\n environment: environment,\n allowedPaymentMethods: [{\n type: \"CARD\",\n parameters: {\n allowedAuthMethods: [\"PAN_ONLY\", \"CRYPTOGRAM_3DS\"],\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(function (card) {\n return card.toUpperCase();\n })\n },\n tokenizationSpecification: {\n type: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:authorizationFingerprint\": androidPayConfiguration.googleAuthorizationFingerprint\n })\n }\n }]\n };\n if (googleMerchantId) {\n data.merchantInfo = {\n merchantId: googleMerchantId\n };\n }\n if (androidPayConfiguration.paypalClientId) {\n paypalPaymentMethod = {\n type: \"PAYPAL\",\n parameters: {\n /* eslint-disable camelcase */\n purchase_context: {\n purchase_units: [{\n payee: {\n client_id: androidPayConfiguration.paypalClientId\n },\n recurring_payment: true\n }]\n }\n /* eslint-enable camelcase */\n },\n tokenizationSpecification: {\n type: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:paypalClientId\": androidPayConfiguration.paypalClientId\n })\n }\n };\n data.allowedPaymentMethods.push(paypalPaymentMethod);\n }\n } else {\n data = {\n environment: environment,\n allowedPaymentMethods: [\"CARD\", \"TOKENIZED_CARD\"],\n paymentMethodTokenizationParameters: {\n tokenizationType: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:authorizationFingerprint\": androidPayConfiguration.googleAuthorizationFingerprint\n })\n },\n cardRequirements: {\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(function (card) {\n return card.toUpperCase();\n })\n }\n };\n if (configuration.authorizationType === \"TOKENIZATION_KEY\") {\n data.paymentMethodTokenizationParameters.parameters[\"braintree:clientKey\"] = configuration.authorization;\n }\n if (googleMerchantId) {\n data.merchantId = googleMerchantId;\n }\n if (googlePayVersion) {\n data.apiVersion = googlePayVersion;\n }\n }\n return data;\n };\n }, {\n \"./assign\": 121\n }],\n 150: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function inIframe(win) {\n win = win || window;\n try {\n return win.self !== win.top;\n } catch (e) {\n return true;\n }\n };\n }, {}],\n 151: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function convertDateStringToDate(dateString) {\n var splitDate = dateString.split(\"-\");\n return new Date(splitDate[0], splitDate[1], splitDate[2]);\n }\n function isDateStringBeforeOrOn(firstDate, secondDate) {\n return convertDateStringToDate(firstDate) <= convertDateStringToDate(secondDate);\n }\n module.exports = isDateStringBeforeOrOn;\n }, {}],\n 152: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function isHTTPS(protocol) {\n protocol = protocol || window.location.protocol;\n return protocol === \"https:\";\n }\n module.exports = {\n isHTTPS: isHTTPS\n };\n }, {}],\n 153: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var parser;\n var legalHosts = {\n \"paypal.com\": 1,\n \"braintreepayments.com\": 1,\n \"braintreegateway.com\": 1,\n \"braintree-api.com\": 1\n };\n\n // endRemoveIf(production)\n\n function stripSubdomains(domain) {\n return domain.split(\".\").slice(-2).join(\".\");\n }\n function isVerifiedDomain(url) {\n var mainDomain;\n url = url.toLowerCase();\n if (!/^https:/.test(url)) {\n return false;\n }\n parser = parser || document.createElement(\"a\");\n parser.href = url;\n mainDomain = stripSubdomains(parser.hostname);\n return legalHosts.hasOwnProperty(mainDomain);\n }\n module.exports = isVerifiedDomain;\n }, {}],\n 154: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (value) {\n return JSON.parse(JSON.stringify(value));\n };\n }, {}],\n 155: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (obj) {\n return Object.keys(obj).filter(function (key) {\n return typeof obj[key] === \"function\";\n });\n };\n }, {}],\n 156: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function once(fn) {\n var called = false;\n return function () {\n if (!called) {\n called = true;\n fn.apply(null, arguments);\n }\n };\n }\n module.exports = once;\n }, {}],\n 157: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function _notEmpty(obj) {\n var key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n }\n return false;\n }\n\n /* eslint-disable no-mixed-operators */\n function _isArray(value) {\n return value && typeof value === \"object\" && typeof value.length === \"number\" && Object.prototype.toString.call(value) === \"[object Array]\" || false;\n }\n /* eslint-enable no-mixed-operators */\n\n function hasQueryParams(url) {\n url = url || window.location.href;\n return /\\?/.test(url);\n }\n function parse(url) {\n var query, params;\n url = url || window.location.href;\n if (!hasQueryParams(url)) {\n return {};\n }\n query = url.split(\"?\")[1] || \"\";\n query = query.replace(/#.*$/, \"\").split(\"&\");\n params = query.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split(\"=\");\n var key = decodeURIComponent(parts[0]);\n var value = decodeURIComponent(parts[1]);\n toReturn[key] = value;\n return toReturn;\n }, {});\n return params;\n }\n function stringify(params, namespace) {\n var k, v, p;\n var query = [];\n for (p in params) {\n if (!params.hasOwnProperty(p)) {\n continue;\n }\n v = params[p];\n if (namespace) {\n if (_isArray(params)) {\n k = namespace + \"[]\";\n } else {\n k = namespace + \"[\" + p + \"]\";\n }\n } else {\n k = p;\n }\n if (typeof v === \"object\") {\n query.push(stringify(v, k));\n } else {\n query.push(encodeURIComponent(k) + \"=\" + encodeURIComponent(v));\n }\n }\n return query.join(\"&\");\n }\n function queryify(url, params) {\n url = url || \"\";\n if (params != null && typeof params === \"object\" && _notEmpty(params)) {\n url += url.indexOf(\"?\") === -1 ? \"?\" : \"\";\n url += url.indexOf(\"=\") !== -1 ? \"&\" : \"\";\n url += stringify(params);\n }\n return url;\n }\n module.exports = {\n parse: parse,\n stringify: stringify,\n queryify: queryify,\n hasQueryParams: hasQueryParams\n };\n }, {}],\n 158: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var uuid = _dereq_(\"@braintree/uuid\");\n var findRootNode = _dereq_(\"./find-root-node\");\n\n // based on https://github.com/krakenjs/belter/blob/cdddc4f8ddb172d29db9e7e1ad1eeeacfb93e215/src/dom.js#L981-L1031\n // thanks @bluepnume\n\n function isShadowElement(element) {\n element = findRootNode(element);\n return element.toString() === \"[object ShadowRoot]\";\n }\n function getShadowHost(element) {\n element = findRootNode(element);\n if (!isShadowElement(element)) {\n return null;\n }\n return element.host;\n }\n function transformToSlot(element, styles) {\n var styleNode = findRootNode(element).querySelector(\"style\");\n var shadowHost = getShadowHost(element);\n var slotName = \"shadow-slot-\" + uuid();\n var slot = document.createElement(\"slot\");\n var slotProvider = document.createElement(\"div\");\n slot.setAttribute(\"name\", slotName);\n element.appendChild(slot);\n slotProvider.setAttribute(\"slot\", slotName);\n shadowHost.appendChild(slotProvider);\n if (styles) {\n if (!styleNode) {\n styleNode = document.createElement(\"style\");\n element.appendChild(styleNode);\n }\n styleNode.sheet.insertRule('::slotted([slot=\"' + slotName + '\"]) { ' + styles + \" }\");\n }\n if (isShadowElement(shadowHost)) {\n return transformToSlot(slotProvider, styles);\n }\n return slotProvider;\n }\n module.exports = {\n isShadowElement: isShadowElement,\n getShadowHost: getShadowHost,\n transformToSlot: transformToSlot\n };\n }, {\n \"./find-root-node\": 136,\n \"@braintree/uuid\": 39\n }],\n 159: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = function (snakeString) {\n if (snakeString.indexOf(\"_\") === -1) {\n return snakeString;\n }\n return snakeString.toLowerCase().replace(/(\\_\\w)/g, function (match) {\n return match[1].toUpperCase();\n });\n };\n }, {}],\n 160: [function (_dereq_, module, exports) {\n \"use strict\";\n\n function useMin(isDebug) {\n return isDebug ? \"\" : \".min\";\n }\n module.exports = useMin;\n }, {}],\n 161: [function (_dereq_, module, exports) {\n \"use strict\";\n\n // NEXT_MAJOR_VERSION old versions of IE don't have atob, in the\n // next major version, we're dropping support for those versions\n // so we can eliminate the need to have this atob polyfill\n var atobNormalized = typeof atob === \"function\" ? atob : atobPolyfill;\n function atobPolyfill(base64String) {\n var a, b, c, b1, b2, b3, b4, i;\n var base64Matcher = new RegExp(\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$\");\n var characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var result = \"\";\n if (!base64Matcher.test(base64String)) {\n throw new Error(\"Non base64 encoded input passed to window.atob polyfill\");\n }\n i = 0;\n do {\n b1 = characters.indexOf(base64String.charAt(i++));\n b2 = characters.indexOf(base64String.charAt(i++));\n b3 = characters.indexOf(base64String.charAt(i++));\n b4 = characters.indexOf(base64String.charAt(i++));\n a = (b1 & 0x3f) << 2 | b2 >> 4 & 0x3;\n b = (b2 & 0xf) << 4 | b3 >> 2 & 0xf;\n c = (b3 & 0x3) << 6 | b4 & 0x3f;\n result += String.fromCharCode(a) + (b ? String.fromCharCode(b) : \"\") + (c ? String.fromCharCode(c) : \"\");\n } while (i < base64String.length);\n return result;\n }\n module.exports = {\n atob: function (base64String) {\n return atobNormalized.call(window, base64String);\n },\n _atob: atobPolyfill\n };\n }, {}],\n 162: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n REQUIRED_OPTIONS_FOR_START_PAYMENT: [\"givenName\", \"surname\", \"currencyCode\", \"onPaymentStart\", \"paymentType\", \"amount\", \"fallback\"],\n REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE: [\"givenName\", \"surname\", \"currencyCode\", \"onPaymentStart\", \"paymentType\", \"amount\", \"address\", \"billingAddress\", \"birthDate\", \"email\", \"locale\", \"customerServiceInstructions\", \"correlationId\", \"phone\", \"phoneCountryCode\", \"lineItems\"],\n REQUIRED_OPTIONS_FOR_ADDRESS: [\"streetAddress\", \"locality\", \"postalCode\", \"countryCode\"],\n REQUIRED_OPTIONS_FOR_LINE_ITEMS: [\"category\", \"name\", \"quantity\", \"unitAmount\", \"unitTaxAmount\"],\n REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE: [\"givenName\", \"surname\", \"currencyCode\", \"onPaymentStart\", \"paymentType\", \"amount\"],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0: [\"authCode\"],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST: [\"authCode\", \"consumerReference\", \"aliasLabel\"],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT: [\"consumerReference\", \"aliasKey\"]\n };\n }, {}],\n 163: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var frameService = _dereq_(\"../../lib/frame-service/external\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var VERSION = \"3.101.1\";\n var INTEGRATION_TIMEOUT_MS = _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\n var analytics = _dereq_(\"../../lib/analytics\");\n var methods = _dereq_(\"../../lib/methods\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var querystring = _dereq_(\"../../lib/querystring\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var constants = _dereq_(\"./constants\");\n var errors = _dereq_(\"../shared/errors\");\n var DEFAULT_WINDOW_WIDTH = 1282;\n var DEFAULT_WINDOW_HEIGHT = 720;\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/local-payment.create|local-payment.create}\n * @classdesc This class represents a LocalPayment component. Instances of this class can open a LocalPayment window for paying with alternate payments local to a specific country. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * @description Do not use this constructor directly. Use {@link module:braintree-web/local-payment.create|braintree-web.local-payment.create} instead.\n */\n function LocalPayment(options) {\n this._client = options.client;\n this._assetsUrl = options.client.getConfiguration().gatewayConfiguration.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl = this._assetsUrl + \"/html/local-payment-landing-frame\" + useMin(this._isDebug) + \".html\";\n this._authorizationInProgress = false;\n this._paymentType = \"unknown\";\n this._merchantAccountId = options.merchantAccountId;\n }\n LocalPayment.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, \"local-payment.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n return new Promise(function (resolve) {\n frameService.create({\n name: \"localpaymentlandingpage\",\n dispatchFrameUrl: self._assetsUrl + \"/html/dispatch-frame\" + useMin(self._isDebug) + \".html\",\n openFrameUrl: self._loadingFrameUrl\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, \"local-payment.load.succeeded\");\n resolve(self);\n });\n });\n };\n\n /**\n * Options used for most local payment types.\n * @typedef {object} LocalPayment~StartPaymentOptions\n * @property {object} fallback Configuration for what to do when app switching back from a Bank app on a mobile device.\n * @property {string} fallback.buttonText The text to display in a button to redirect back to the merchant page.\n * @property {string} fallback.url The url to redirect to when the redirect button is pressed. Query params will be added to the url to process the data returned from the bank.\n * @property {string} fallback.cancelButtonText The text to display in a button to redirect back to the merchant page when the customer cancels. If no `cancelButtonText` is provided, `buttonText` will be used.\n * @property {string} fallback.cancelUrl The url to redirect to when the redirect button is pressed when the customer cancels. Query params will be added to the url to check the state of the payment. If no `cancelUrl` is provided, `url` will be used.\n * @property {object} [windowOptions] The options for configuring the window that is opened when starting the payment.\n * @property {number} [windowOptions.width=1282] The width in pixels of the window opened when starting the payment. The default width size is this large to allow various banking partner landing pages to display the QR Code to be scanned by the bank's mobile app. Many will not display the QR code when the window size is smaller than a standard desktop screen.\n * @property {number} [windowOptions.height=720] The height in pixels of the window opened when starting the payment.\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. See https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom\n * @property {string} paymentTypeCountryCode The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {string} bic Bank Identification Code of the customer (specific to iDEAL transactions).\n * @property {boolean} recurrent Enable recurrent payment.\n * @property {string} customerId The customer's id in merchant's system (required for recurrent payments).\n * @property {boolean} shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} address.extendedAddress Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} address.region Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {function} onPaymentStart A function that will be called with two parameters: an object containing the `paymentId` and a `continueCallback` that must be called to launch the flow. You can use method to do any preprocessing on your server before the flow begins..\n */\n\n /**\n * Options used for the Pay Upon Invoice local payment type.\n * @typedef {object} LocalPayment~StartPaymentPayUponInvoiceOptions\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. Must be `pay_upon_invoice`.\n * @property {string} [paymentTypeCountryCode] The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {string} phoneCountryCode The country calling code.\n * @property {string} birthDate The birth date of the customer in `YYYY-MM-DD` format.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} [address.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} [address.region] Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {string} [shippingAmount] The shipping fee for all items. This value can not be a negative number.\n * @property {string} [discountAmount] The discount for all items. This value can not be a negative number.\n * @property {object} billingAddress The billing address.\n * @property {string} billingAddress.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} [billingAddress.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} billingAddress.locality Customer's city.\n * @property {string} [billingAddress.region] Customer's region or state.\n * @property {string} billingAddress.postalCode Customer's postal code.\n * @property {string} billingAddress.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {object[]} lineItems List of line items.\n * @property {string} lineItems.category The item category type: `'DIGITAL_GOODS'`, `'PHYSICAL_GOODS'`, or `'DONATION'`.\n * @property {string} lineItems.name Item name. Maximum 127 characters.\n * @property {string} lineItems.quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} lineItems.unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} lineItems.unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative.\n * @property {string} locale The BCP 47-formatted locale. PayPal supports a five-character code. For example, `en-DE`, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.\n * @property {string} customerServiceInstructions Instructions for how to contact the merchant's customer service. Maximum 4,000 characters.\n * @property {string} correlationId Used to correlate user sessions with server transactions.\n * @property {function} onPaymentStart A function that will be called with an object containing the `paymentId`. The `continueCallback` is not provided as it is not needed for this use case.\n */\n\n /**\n * Options used for the seamless/oneclick BLIK local payment type.\n * @typedef {object} LocalPayment~StartPaymentOptions\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. Must be `blik`.\n * @property {string} paymentTypeCountryCode The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {boolean} shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} address.extendedAddress Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} address.region Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {object} blikOptions Blik seamless/oneclick specific options. Should contain only one object: `level_0` or `oneClick`.\n * @property {object} blikOptions.level_0 Blik seamless specific options.\n * @property {string} blikOptions.level_0.authCode 6-digit code used to authenticate a consumer within BLIK.\n * @property {object} blikOptions.oneClick Blik oneclick specific options.\n * @property {string} blikOptions.oneClick.authCode 6-digit code used to authenticate a consumer within BLIK.\n * @property {string} blikOptions.oneClick.consumerReference The merchant generated, unique reference serving as a primary identifier for accounts connected between Blik and a merchant.\n * @property {string} blikOptions.oneClick.aliasLabel A bank defined identifier used as a display name to allow the payer to differentiate between multiple registered bank accounts.\n * @property {string} blikOptions.oneClick.aliasKey A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given merchant. Used only in conjunction with a Consumer Reference.\n * @property {function} onPaymentStart A function that will be called with an object containing the `paymentId`. The `continueCallback` is not provided as it is not needed for this use case.\n */\n\n /**\n * Launches the local payment flow and returns a nonce payload. Only one local payment flow should be active at a time. One way to achieve this is to disable your local payment button while the flow is open.\n * @public\n * @function\n * @param {LocalPayment~StartPaymentOptions|LocalPayment~StartPaymentPayUponInvoiceOptions} options Options for initiating the local payment payment flow.\n * @param {callback} callback The second argument, data, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * paymentTypeCountryCode: 'NL',\n * fallback: {\n * buttonText: 'Return to Merchant',\n * url: 'https://example.com/my-checkout-page'\n * },\n * amount: '10.00',\n * currencyCode: 'EUR',\n * givenName: 'Joe',\n * surname: 'Doe',\n * address: {\n * countryCode: 'NL'\n * },\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing before starting the flow\n * // data.paymentId is the ID of the localPayment\n * continueCallback();\n * }\n * }).then(function (payload) {\n * // Submit payload.nonce to your server\n * }).catch(function (startPaymentError) {\n * // Handle flow errors or premature flow closure\n * console.error('Error!', startPaymentError);\n * });\n * @example Pay Upon Invoice\n * localPaymentInstance.startPayment({\n * paymentType: 'pay_upon_invoice',\n * amount: '100.00',\n * currencyCode: 'EUR',\n * givenName: 'Max',\n * surname: 'Mustermann',\n * address: { // This is used as the shipping address.\n * streetAddress: 'Taunusanlage 12',\n * locality: 'Frankfurt',\n * postalCode: '60325',\n * countryCode: 'DE',\n * },\n * billingAddress: {\n * streetAddress: 'Schönhauser Allee 84',\n * locality: 'Berlin',\n * postalCode: '10439',\n * countryCode: 'DE'\n * },\n * birthDate: '1990-01-01',\n * email: 'buyer@example.com',\n * locale: 'en-DE',\n * customerServiceInstructions: 'Customer service phone is +49 6912345678.',\n * lineItems: [{\n * category: 'PHYSICAL_GOODS',\n * name: 'Basketball Shoes',\n * quantity: '1',\n * unitAmount: '81.00',\n * unitTaxAmount: '19.00',\n * }],\n * phone: '6912345678',\n * phoneCountryCode: '49',\n * correlationId: correlationId,\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example BLIK seamless\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * level_0: {\n * authCode: \"123456\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example BLIK oneclick first payment\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * oneClick: {\n * authCode: \"123456\",\n * consumerReference: \"ABCde123\",\n * aliasLabel: \"my uniq alias\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example BLIK oneclick subsequent payment\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * oneClick: {\n * consumerReference: \"ABCde123\",\n * aliasKey: \"123456789\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n */\n LocalPayment.prototype.startPayment = function (options) {\n var missingOption, missingError, address, fallback, params, promise, billingAddress, windowOptions, onPaymentStartPromise;\n var self = this; // eslint-disable-line no-invalid-this\n var serviceId = this._frameService._serviceId; // eslint-disable-line no-invalid-this\n\n // In order to provide the merchant with appropriate error messaging,\n // more robust validation is being done on the client-side, since some\n // option names are mapped to legacy names for the sake of the API.\n // For example, if `billingAddress.streetAddress` was missing, then\n // the API error response would say that `billing_address.line1` was\n // missing. This client-side validation will correctly tell the\n // merchant that `billingAddress.streetAddress` was missing.\n missingOption = hasMissingOption(options);\n if (missingOption) {\n missingError = new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION);\n if (typeof missingOption === \"string\") {\n missingError.details = \"Missing required '\" + missingOption + \"' option.\";\n }\n return Promise.reject(missingError);\n }\n windowOptions = options.windowOptions || {};\n address = options.address || {};\n fallback = options.fallback || {};\n billingAddress = options.billingAddress || {};\n params = {\n amount: options.amount,\n bic: options.bic,\n billingAddress: {\n line1: billingAddress.streetAddress,\n line2: billingAddress.extendedAddress,\n city: billingAddress.locality,\n state: billingAddress.region,\n postalCode: billingAddress.postalCode,\n countryCode: billingAddress.countryCode\n },\n birthDate: options.birthDate,\n blikOptions: options.blikOptions,\n cancelUrl: querystring.queryify(self._assetsUrl + \"/html/local-payment-redirect-frame\" + useMin(self._isDebug) + \".html\", {\n channel: serviceId,\n r: fallback.cancelUrl || fallback.url,\n t: fallback.cancelButtonText || fallback.buttonText,\n c: 1 // indicating we went through the cancel flow\n }),\n city: address.locality,\n correlationId: options.correlationId,\n countryCode: address.countryCode,\n currencyIsoCode: options.currencyCode,\n discountAmount: options.discountAmount,\n experienceProfile: {\n brandName: options.displayName,\n customerServiceInstructions: options.customerServiceInstructions,\n locale: options.locale,\n noShipping: !options.shippingAddressRequired\n },\n firstName: options.givenName,\n fundingSource: options.paymentType,\n intent: \"sale\",\n lastName: options.surname,\n line1: address.streetAddress,\n line2: address.extendedAddress,\n lineItems: options.lineItems,\n merchantAccountId: self._merchantAccountId,\n merchantOrPartnerCustomerId: options.customerId,\n payerEmail: options.email,\n paymentTypeCountryCode: options.paymentTypeCountryCode,\n phone: options.phone,\n phoneCountryCode: options.phoneCountryCode,\n postalCode: address.postalCode,\n recurrent: options.recurrent,\n returnUrl: querystring.queryify(self._assetsUrl + \"/html/local-payment-redirect-frame\" + useMin(self._isDebug) + \".html\", {\n channel: serviceId,\n r: fallback.url,\n t: fallback.buttonText\n }),\n shippingAmount: options.shippingAmount,\n state: address.region\n };\n self._paymentType = options.paymentType.toLowerCase();\n if (self._authorizationInProgress) {\n analytics.sendEvent(self._client, self._paymentType + \".local-payment.start-payment.error.already-opened\");\n return Promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_ALREADY_IN_PROGRESS));\n }\n self._authorizationInProgress = true;\n promise = new ExtendedPromise();\n\n // For deferred payment types, the popup window should not be opened,\n // since the actual payment will be done outside of this session.\n if (!isDeferredPaymentTypeOptions(options)) {\n self._startPaymentCallback = self._createStartPaymentCallback(function (val) {\n promise.resolve(val);\n }, function (err) {\n promise.reject(err);\n });\n self._frameService.open({\n width: windowOptions.width || DEFAULT_WINDOW_WIDTH,\n height: windowOptions.height || DEFAULT_WINDOW_HEIGHT\n }, self._startPaymentCallback);\n }\n self._client.request({\n method: \"post\",\n endpoint: \"local_payments/create\",\n data: params\n }).then(function (response) {\n var redirectUrl = response.paymentResource.redirectUrl;\n analytics.sendEvent(self._client, self._paymentType + \".local-payment.start-payment.opened\");\n self._startPaymentOptions = options;\n if (isDeferredPaymentTypeOptions(options)) {\n self._authorizationInProgress = false;\n if (typeof redirectUrl === \"string\" && redirectUrl.length) {\n promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED));\n } else {\n onPaymentStartPromise = options.onPaymentStart({\n paymentId: response.paymentResource.paymentToken\n });\n if (onPaymentStartPromise instanceof Promise) {\n onPaymentStartPromise.then(function () {\n promise.resolve();\n });\n } else {\n promise.resolve();\n }\n }\n } else {\n options.onPaymentStart({\n paymentId: response.paymentResource.paymentToken\n }, function () {\n self._frameService.redirect(response.paymentResource.redirectUrl);\n });\n }\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n self._frameService.close();\n self._authorizationInProgress = false;\n if (status === 422) {\n promise.reject(new BraintreeError({\n type: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.type,\n code: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.code,\n message: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n return;\n }\n promise.reject(convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.type,\n code: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.code,\n message: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.message\n }));\n });\n return promise;\n };\n\n /**\n * Manually tokenizes params for a local payment received from PayPal.When app switching back from a mobile application (such as a bank application for an iDEAL payment), the window may lose context with the parent page. In that case, a fallback url is used, and this method can be used to finish the flow.\n * @public\n * @function\n * @param {object} [params] All options for tokenizing local payment parameters. If no params are passed in, the params will be pulled off of the query string of the page.\n * @param {string} params.btLpToken The token representing the local payment. Aliased to `token` if `btLpToken` is not present.\n * @param {string} params.btLpPaymentId The payment id for the local payment. Aliased to `paymentId` if `btLpPaymentId` is not present.\n * @param {string} params.btLpPayerId The payer id for the local payment. Aliased to `PayerID` if `btLpPayerId` is not present.\n * @param {callback} [callback] The second argument, data, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @example\n * localPaymentInstance.tokenize().then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * // handle tokenization error\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n LocalPayment.prototype.tokenize = function (params) {\n var self = this;\n var client = this._client;\n params = params || querystring.parse();\n\n // iOS Safari parses query params by adding the params inside an object called: queryItems\n if (params.queryItems) {\n params = params.queryItems;\n }\n if (params.c || params.wasCanceled) {\n return Promise.reject(new BraintreeError({\n type: errors.LOCAL_PAYMENT_CANCELED.type,\n code: errors.LOCAL_PAYMENT_CANCELED.code,\n message: errors.LOCAL_PAYMENT_CANCELED.message,\n details: {\n originalError: {\n errorcode: params.errorcode,\n token: params.btLpToken\n }\n }\n }));\n } else if (params.errorcode) {\n return Promise.reject(new BraintreeError({\n type: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.type,\n code: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.code,\n message: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.message,\n details: {\n originalError: {\n errorcode: params.errorcode,\n token: params.btLpToken\n }\n }\n }));\n }\n return client.request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: this._formatTokenizeData(params)\n }).then(function (response) {\n var payload = self._formatTokenizePayload(response);\n if (window.popupBridge) {\n analytics.sendEvent(client, self._paymentType + \".local-payment.tokenization.success-popupbridge\");\n } else {\n analytics.sendEvent(client, self._paymentType + \".local-payment.tokenization.success\");\n }\n return payload;\n }).catch(function (err) {\n analytics.sendEvent(client, self._paymentType + \".local-payment.tokenization.failed\");\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.type,\n code: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.code,\n message: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.message\n }));\n });\n };\n\n /**\n * Closes the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.closeWindow();\n * @returns {void}\n */\n LocalPayment.prototype.closeWindow = function () {\n if (this._authoriztionInProgress) {\n analytics.sendEvent(this._client, this._paymentType + \".local-payment.start-payment.closed.by-merchant\");\n }\n this._frameService.close();\n };\n\n /**\n * Focuses the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.focusWindow();\n * @returns {void}\n */\n LocalPayment.prototype.focusWindow = function () {\n this._frameService.focus();\n };\n LocalPayment.prototype._createStartPaymentCallback = function (resolve, reject) {\n var self = this;\n var client = this._client;\n return function (err, params) {\n self._authorizationInProgress = false;\n if (err) {\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n if (params && params.errorcode === \"processing_error\") {\n // something failed within the payment window (rather than when\n // tokenizing with Braintree)\n analytics.sendEvent(client, self._paymentType + \".local-payment.failed-in-window\");\n reject(new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_FAILED));\n return;\n }\n\n // its possible to have a query param with errorcode=payment_error, which\n // indicates that the customer cancelled the flow from within the UI,\n // but as there's no meaningful difference to the merchant whether the\n // customer closes via the UI or by manually closing the window, we\n // don't differentiate these\n analytics.sendEvent(client, self._paymentType + \".local-payment.tokenization.closed.by-user\");\n reject(new BraintreeError(errors.LOCAL_PAYMENT_WINDOW_CLOSED));\n } else if (err.code && err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1) {\n reject(new BraintreeError({\n code: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.code,\n type: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.type,\n message: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n } else if (params) {\n if (!window.popupBridge) {\n self._frameService.redirect(self._loadingFrameUrl);\n }\n self.tokenize(params).then(resolve).catch(reject).then(function () {\n self._frameService.close();\n });\n }\n };\n };\n LocalPayment.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n if (account.details) {\n if (account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n if (account.details.correlationId) {\n payload.correlationId = account.details.correlationId;\n }\n }\n return payload;\n };\n\n /**\n * Checks if required tokenization parameters are available in querystring for manual tokenization requests.\n * @public\n * @function\n * @example\n * // if query string contains\n * // ?btLpToken=token&btLpPaymentId=payment-id&btLpPayerId=payer-id\n * localPaymentInstance.hasTokenizationParams(); // true\n *\n * // if query string is missing required params\n * localPaymentInstance.hasTokenizationParams(); // false\n *\n * if (localPaymentInstance.hasTokenizationParams()) {\n * localPaymentInstance.tokenize();\n * }\n * @returns {Boolean} Returns a Boolean value for the state of the query string.\n */\n LocalPayment.prototype.hasTokenizationParams = function () {\n var params = querystring.parse();\n if (params.errorcode) {\n return true;\n }\n return Boolean(params.btLpToken && params.btLpPaymentId && params.btLpPayerId);\n };\n LocalPayment.prototype._formatTokenizeData = function (params) {\n var clientConfiguration = this._client.getConfiguration();\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var data = {\n merchantAccountId: this._merchantAccountId,\n paypalAccount: {\n correlationId: params.btLpToken || params.token,\n paymentToken: params.btLpPaymentId || params.paymentId,\n payerId: params.btLpPayerId || params.PayerID,\n unilateral: gatewayConfiguration.paypal.unvettedMerchant,\n intent: \"sale\"\n }\n };\n return data;\n };\n\n // Some payment types are deferred. Meaning, the actual payment will\n // occur at a later time outside of this session. For example, with\n // Pay Upon Invoice, the customer will later receive an email that will\n // be used to make the actual payment through RatePay. This function\n // will return `true` if the given options contain `paymentType` of\n // a deferred payment type; and/or some payments, like blik, may have\n // specific extra options to be treated as deferred. Otherwise, it\n // will return `false`.\n function isDeferredPaymentTypeOptions(options) {\n var blikOptions = options.blikOptions || {};\n var paymentType = typeof options.paymentType === \"string\" ? options.paymentType.toLowerCase() : options.paymentType;\n if (paymentType === \"pay_upon_invoice\") {\n return true;\n } else if (paymentType === \"blik\") {\n return blikOptions.hasOwnProperty(\"level_0\") || blikOptions.hasOwnProperty(\"oneClick\");\n }\n return false;\n }\n function hasMissingAddressOption(options) {\n var i, option;\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_ADDRESS.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_ADDRESS[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n return false;\n }\n function hasMissingLineItemsOption(items) {\n var i, j, item, option;\n for (j = 0; j < items.length; j++) {\n item = items[j];\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_LINE_ITEMS.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_LINE_ITEMS[i];\n if (!item.hasOwnProperty(option)) {\n return option;\n }\n }\n }\n return false;\n }\n function hasMissingBlikOptions(options) {\n var i, option, oneClick;\n var blikOptions = options.blikOptions || {};\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n if (blikOptions.hasOwnProperty(\"level_0\")) {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0[i];\n\n // eslint-disable-next-line camelcase\n if (!blikOptions.level_0.hasOwnProperty(option)) {\n return \"blikOptions.level_0.\" + option;\n }\n }\n } else if (blikOptions.hasOwnProperty(\"oneClick\")) {\n oneClick = blikOptions.oneClick || {};\n if (oneClick.hasOwnProperty(\"aliasKey\")) {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT[i];\n if (!oneClick.hasOwnProperty(option)) {\n return \"blikOptions.oneClick.\" + option;\n }\n }\n } else {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST[i];\n if (!oneClick.hasOwnProperty(option)) {\n return \"blikOptions.oneClick.\" + option;\n }\n }\n }\n }\n return false;\n }\n\n // This will return the name of the first missing required option that\n // is found or `true` if `options` itself is not defined. Otherwise, it\n // will return `false`.\n function hasMissingOption(options) {\n var i, option, missingAddressOption, missingLineItemOption, paymentType;\n if (!options) {\n return true;\n }\n if (isDeferredPaymentTypeOptions(options)) {\n paymentType = options.paymentType || \"\";\n if (paymentType.toLowerCase() === \"pay_upon_invoice\") {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n if (option === \"address\" || option === \"billingAddress\") {\n missingAddressOption = hasMissingAddressOption(options[option]);\n if (missingAddressOption) {\n return option + \".\" + missingAddressOption;\n }\n } else if (option === \"lineItems\") {\n missingLineItemOption = hasMissingLineItemsOption(options[option]);\n if (missingLineItemOption) {\n return option + \".\" + missingLineItemOption;\n }\n }\n }\n } else if (paymentType.toLowerCase() === \"blik\") {\n return hasMissingBlikOptions(options);\n }\n } else {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_START_PAYMENT.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_START_PAYMENT[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n if (!options.fallback.url) {\n return \"fallback.url\";\n }\n if (!options.fallback.buttonText) {\n return \"fallback.buttonText\";\n }\n if (options.recurrent === true && !options.customerId) {\n return \"customerId\";\n }\n }\n return false;\n }\n\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/local-payment.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * localPaymentInstance.teardown();\n * @example With callback\n * localPaymentInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n LocalPayment.prototype.teardown = function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n convertMethodsToError(self, methods(LocalPayment.prototype));\n analytics.sendEvent(self._client, \"local-payment.teardown-completed\");\n return Promise.resolve();\n };\n module.exports = wrapPromise.wrapPrototype(LocalPayment);\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/braintree-error\": 124,\n \"../../lib/constants\": 126,\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/convert-to-braintree-error\": 128,\n \"../../lib/frame-service/external\": 139,\n \"../../lib/methods\": 155,\n \"../../lib/querystring\": 157,\n \"../../lib/use-min\": 160,\n \"../shared/errors\": 165,\n \"./constants\": 162,\n \"@braintree/extended-promise\": 34,\n \"@braintree/wrap-promise\": 43\n }],\n 164: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/local-payment\n * @description A component to integrate with local payment methods. *This component is currently in beta and is subject to change.*\n */\n var analytics = _dereq_(\"../lib/analytics\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var LocalPayment = _dereq_(\"./external/local-payment\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var errors = _dereq_(\"./shared/errors\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization and creation of the authorizing transaction. Braintree strongly recommends specifying this parameter.\n * @param {callback} callback The second argument, `data`, is the {@link LocalPayment} instance.\n * @example Using the local payment component to set up an iDEAL button\n * var idealButton = document.querySelector('.ideal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.localPayment.create({\n * client: clientInstance,\n * merchantAccountId: 'merchantAccountEUR',\n * }, function (localPaymentErr, localPaymentInstance) {\n * if (localPaymentErr) {\n * console.error('Error creating local payment component:', localPaymentErr);\n * return;\n * }\n *\n * idealButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to start the payment flow.\n * idealButton.addEventListener('click', function (event) {\n * // Because this opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * amount: '10.67',\n * city: 'Den Haag',\n * countryCode: 'NL',\n * firstName: 'Test',\n * lastName: 'McTester',\n * line1: '123 of 456 Fake Lane',\n * line2: 'Apartment 789',\n * payerEmail: 'payer@example.com',\n * phone: '123456789',\n * postalCode: '1234 AA',\n * currencyCode: 'EUR',\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing to store the ID and setup webhook\n * // Call start to initiate the popup\n * continueCallback();\n * }\n ** }, function (startPaymentErr, payload) {\n * if (startPaymentErr) {\n * if (startPaymentErr.type !== 'CUSTOMER') {\n * console.error('Error starting payment:', startPaymentErr);\n * }\n * return;\n * }\n *\n * idealButton.setAttribute('disabled', true);\n *\n * console.log(payload.paymentId);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"Local Payment\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var localPaymentInstance;\n var config = client.getConfiguration();\n options.client = client;\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(new BraintreeError(errors.LOCAL_PAYMENT_NOT_ENABLED));\n }\n analytics.sendEvent(client, \"local-payment.initialized\");\n localPaymentInstance = new LocalPayment(options);\n return localPaymentInstance._initialize();\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./external/local-payment\": 163,\n \"./shared/errors\": 165,\n \"@braintree/wrap-promise\": 43\n }],\n 165: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.LocalPayment - Creation Error Codes\n * @description Errors that occur when [creating the Local Payment component](./module-braintree-web_local-payment.html#.create).\n * @property {MERCHANT} LOCAL_PAYMENT_NOT_ENABLED Occurs when Local Payment is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.LocalPayment - startPayment Error Codes\n * @description Errors that occur when using the [`startPayment` method](./LocalPayment.html#startPayment).\n * @property {MERCHANT} LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION Occurs when a startPayment is missing a required option.\n * @property {MERCHANT} LOCAL_PAYMENT_ALREADY_IN_PROGRESS Occurs when a startPayment call is already in progress.\n * @property {MERCHANT} LOCAL_PAYMENT_INVALID_PAYMENT_OPTION Occurs when a startPayment call has an invalid option.\n * @property {NETWORK} LOCAL_PAYMENT_START_PAYMENT_FAILED Occurs when a startPayment call fails.\n * @property {NETWORK} LOCAL_PAYMENT_TOKENIZATION_FAILED Occurs when a startPayment call fails to tokenize the result from authorization.\n * @property {CUSTOMER} LOCAL_PAYMENT_CANCELED Occurs when the customer cancels the Local Payment.\n * @property {CUSTOMER} LOCAL_PAYMENT_WINDOW_CLOSED Occurs when the customer closes the Local Payment window.\n * @property {MERCHANT} LOCAL_PAYMENT_WINDOW_OPEN_FAILED Occurs when the Local Payment window fails to open. Usually because `startPayment` was not called as a direct result of a user action.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n LOCAL_PAYMENT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_NOT_ENABLED\",\n message: \"LocalPayment is not enabled for this merchant.\"\n },\n LOCAL_PAYMENT_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_ALREADY_IN_PROGRESS\",\n message: \"LocalPayment payment is already in progress.\"\n },\n LOCAL_PAYMENT_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"LOCAL_PAYMENT_CANCELED\",\n message: \"Customer canceled the LocalPayment before authorizing.\"\n },\n LOCAL_PAYMENT_WINDOW_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"LOCAL_PAYMENT_WINDOW_CLOSED\",\n message: \"Customer closed LocalPayment window before authorizing.\"\n },\n LOCAL_PAYMENT_WINDOW_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_WINDOW_OPEN_FAILED\",\n message: \"LocalPayment window failed to open; make sure startPayment was called in response to a user action.\"\n },\n LOCAL_PAYMENT_START_PAYMENT_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"LOCAL_PAYMENT_START_PAYMENT_FAILED\",\n message: \"LocalPayment startPayment failed.\"\n },\n LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for startPayment.\"\n },\n LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED\",\n message: \"LocalPayment startPayment deferred payment failed.\"\n },\n LOCAL_PAYMENT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"LOCAL_PAYMENT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's local payment method.\"\n },\n LOCAL_PAYMENT_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_INVALID_PAYMENT_OPTION\",\n message: \"Local payment options are invalid.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 166: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var frameService = _dereq_(\"../../lib/frame-service/external\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var errors = _dereq_(\"../shared/errors\");\n var VERSION = \"3.101.1\";\n var methods = _dereq_(\"../../lib/methods\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var analytics = _dereq_(\"../../lib/analytics\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\n var constants = _dereq_(\"../shared/constants\");\n var INTEGRATION_TIMEOUT_MS = _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\n\n /**\n * Masterpass Address object.\n * @typedef {object} Masterpass~Address\n * @property {string} countryCodeAlpha2 The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n */\n\n /**\n * @typedef {object} Masterpass~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} description The human readable description.\n * @property {string} type The payment method type, always `MasterpassCard`.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} contact The customer's contact information.\n * @property {string} contact.firstName The customer's first name.\n * @property {string} contact.lastName The customer's last name.\n * @property {string} contact.phoneNumber The customer's phone number.\n * @property {string} contact.emailAddress The customer's email address.\n * @property {Masterpass~Address} billingAddress The customer's billing address.\n * @property {Masterpass~Address} shippingAddress The customer's shipping address.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/masterpass.create|masterpass.create}\n * @description You cannot use this constructor directly. Use {@link module:braintree-web/masterpass.create|braintree.masterpass.create} instead.\n * @classdesc This class represents an Masterpass component. Instances of this class have methods for launching a new window to process a transaction with Masterpass.\n */\n function Masterpass(options) {\n var configuration = options.client.getConfiguration();\n this._client = options.client;\n this._assetsUrl = configuration.gatewayConfiguration.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = configuration.isDebug;\n this._authInProgress = false;\n if (window.popupBridge && typeof window.popupBridge.getReturnUrlPrefix === \"function\") {\n this._callbackUrl = window.popupBridge.getReturnUrlPrefix() + \"return\";\n } else {\n this._callbackUrl = this._assetsUrl + \"/html/redirect-frame\" + (this._isDebug ? \"\" : \".min\") + \".html\";\n }\n }\n Masterpass.prototype._initialize = function () {\n var self = this;\n return new Promise(function (resolve) {\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(self._client, \"masterpass.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n frameService.create({\n name: constants.LANDING_FRAME_NAME,\n height: constants.POPUP_HEIGHT,\n width: constants.POPUP_WIDTH,\n dispatchFrameUrl: self._assetsUrl + \"/html/dispatch-frame\" + (self._isDebug ? \"\" : \".min\") + \".html\",\n openFrameUrl: self._assetsUrl + \"/html/masterpass-landing-frame\" + (self._isDebug ? \"\" : \".min\") + \".html\"\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(self._client, \"masterpass.load.succeeded\");\n resolve(self);\n });\n });\n };\n\n /**\n * Launches the Masterpass flow and returns a nonce payload. Only one Masterpass flow should be active at a time. One way to achieve this is to disable your Masterpass button while the flow is open.\n *\n * Braintree will apply these properties in `options.config`. Merchants should not override these values, except for advanced usage.\n * - `environment`\n * - `requestToken`\n * - `callbackUrl`\n * - `merchantCheckoutId`\n * - `allowedCardTypes`\n * - `version`\n *\n * @public\n * @param {object} options All options for initiating the Masterpass payment flow.\n * @param {string} options.currencyCode The currency code to process the payment.\n * @param {string} options.subtotal The amount to authorize for the transaction.\n * @param {object} [options.config] All configuration parameters accepted by Masterpass lightbox, except `function` data type. These options will override the values set by Braintree server. Please see {@link Masterpass Lightbox Parameters|https://developer.mastercard.com/page/masterpass-lightbox-parameters} for more information.\n * @param {object} [options.frameOptions] Used to configure the window that contains the Masterpass login.\n * @param {number} [options.frameOptions.width] Popup width to be used instead of default value (450px).\n * @param {number} [options.frameOptions.height] Popup height to be used instead of default value (660px).\n * @param {number} [options.frameOptions.top] The top position of the popup window to be used instead of default value, that is calculated based on provided height, and parent window size.\n * @param {number} [options.frameOptions.left] The left position to the popup window to be used instead of default value, that is calculated based on provided width, and parent window size.\n * @param {callback} [callback] The second argument, data, is a {@link Masterpass~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Masterpass~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * masterpassInstance.tokenize({\n * currencyCode: 'USD',\n * subtotal: '10.00'\n * }).then(function (payload) {\n * button.removeAttribute('disabled');\n * // Submit payload.nonce to your server\n * }).catch(function (tokenizeError) {\n * button.removeAttribute('disabled');\n * // Handle flow errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'MASTERPASS_POPUP_CLOSED':\n * console.error('Customer closed Masterpass popup.');\n * break;\n * case 'MASTERPASS_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('Masterpass tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'MASTERPASS_FLOW_FAILED':\n * console.error('Unable to initialize Masterpass flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * });\n * });\n */\n Masterpass.prototype.tokenize = function (options) {\n var self = this;\n if (!options || hasMissingOption(options)) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION));\n }\n if (self._authInProgress) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS));\n }\n return new Promise(function (resolve, reject) {\n self._navigateFrameToLoadingPage(options).catch(reject);\n // This MUST happen after _navigateFrameToLoadingPage for Metro browsers to work.\n self._frameService.open(options.frameOptions, self._createFrameOpenHandler(resolve, reject));\n });\n };\n Masterpass.prototype._navigateFrameToLoadingPage = function (options) {\n var self = this;\n this._authInProgress = true;\n return this._client.request({\n method: \"post\",\n endpoint: \"masterpass/request_token\",\n data: {\n requestToken: {\n originUrl: window.location.protocol + \"//\" + window.location.hostname,\n subtotal: options.subtotal,\n currencyCode: options.currencyCode,\n callbackUrl: this._callbackUrl\n }\n }\n }).then(function (response) {\n var redirectUrl = self._assetsUrl + \"/html/masterpass-loading-frame\" + (self._isDebug ? \"\" : \".min\") + \".html?\";\n var gatewayConfiguration = self._client.getConfiguration().gatewayConfiguration;\n var config = options.config || {};\n var queryParams;\n queryParams = {\n environment: gatewayConfiguration.environment,\n requestToken: response.requestToken,\n callbackUrl: self._callbackUrl,\n merchantCheckoutId: gatewayConfiguration.masterpass.merchantCheckoutId,\n allowedCardTypes: gatewayConfiguration.masterpass.supportedNetworks,\n version: constants.MASTERPASS_VERSION\n };\n Object.keys(config).forEach(function (key) {\n if (typeof config[key] !== \"function\") {\n queryParams[key] = config[key];\n }\n });\n redirectUrl += Object.keys(queryParams).map(function (key) {\n return key + \"=\" + queryParams[key];\n }).join(\"&\");\n self._frameService.redirect(redirectUrl);\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n self._closeWindow();\n if (status === 422) {\n return Promise.reject(convertToBraintreeError(err, errors.MASTERPASS_INVALID_PAYMENT_OPTION));\n }\n return Promise.reject(convertToBraintreeError(err, errors.MASTERPASS_FLOW_FAILED));\n });\n };\n Masterpass.prototype._createFrameOpenHandler = function (resolve, reject) {\n var self = this;\n if (window.popupBridge) {\n return function (popupBridgeErr, payload) {\n self._authInProgress = false;\n if (popupBridgeErr) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.closed-popupbridge.by-user\");\n reject(convertToBraintreeError(popupBridgeErr, errors.MASTERPASS_POPUP_CLOSED));\n return;\n } else if (!payload.queryItems) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed-popupbridge\");\n reject(new BraintreeError(errors.MASTERPASS_FLOW_FAILED));\n return;\n }\n self._tokenizeMasterpass(payload.queryItems).then(resolve).catch(reject);\n };\n }\n return function (frameServiceErr, payload) {\n if (frameServiceErr) {\n self._authInProgress = false;\n if (frameServiceErr.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(self._client, \"masterpass.tokenization.closed.by-user\");\n reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n return;\n }\n if (frameServiceErr.code && frameServiceErr.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed.to-open\");\n reject(new BraintreeError({\n code: errors.MASTERPASS_POPUP_OPEN_FAILED.code,\n type: errors.MASTERPASS_POPUP_OPEN_FAILED.type,\n message: errors.MASTERPASS_POPUP_OPEN_FAILED.message,\n details: {\n originalError: frameServiceErr\n }\n }));\n return;\n }\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed\");\n self._closeWindow();\n reject(convertToBraintreeError(frameServiceErr, errors.MASTERPASS_FLOW_FAILED));\n return;\n }\n self._tokenizeMasterpass(payload).then(resolve).catch(reject);\n };\n };\n Masterpass.prototype._tokenizeMasterpass = function (payload) {\n var self = this;\n if (payload.mpstatus !== \"success\") {\n analytics.sendEvent(self._client, \"masterpass.tokenization.closed.by-user\");\n self._closeWindow();\n return Promise.reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n }\n if (isMissingRequiredPayload(payload)) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.closed.missing-payload\");\n self._closeWindow();\n return Promise.reject(new BraintreeError(errors.MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS));\n }\n return self._client.request({\n endpoint: \"payment_methods/masterpass_cards\",\n method: \"post\",\n data: {\n masterpassCard: {\n checkoutResourceUrl: payload.checkout_resource_url,\n requestToken: payload.oauth_token,\n verifierToken: payload.oauth_verifier\n }\n }\n }).then(function (response) {\n self._closeWindow();\n if (window.popupBridge) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.success-popupbridge\");\n } else {\n analytics.sendEvent(self._client, \"masterpass.tokenization.success\");\n }\n return response.masterpassCards[0];\n }).catch(function (tokenizeErr) {\n self._closeWindow();\n if (window.popupBridge) {\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed-popupbridge\");\n } else {\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed\");\n }\n return Promise.reject(convertToBraintreeError(tokenizeErr, errors.MASTERPASS_ACCOUNT_TOKENIZATION_FAILED));\n });\n };\n function isMissingRequiredPayload(payload) {\n return [payload.oauth_verifier, payload.oauth_token, payload.checkout_resource_url].some(function (element) {\n return element == null || element === \"null\";\n });\n }\n Masterpass.prototype._closeWindow = function () {\n this._authInProgress = false;\n this._frameService.close();\n };\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/masterpass.create|create}.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, `teardown` returns a promise.\n * @example\n * masterpassInstance.teardown();\n * @example With callback\n * masterpassInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n Masterpass.prototype.teardown = function () {\n var self = this;\n return new Promise(function (resolve) {\n self._frameService.teardown();\n convertMethodsToError(self, methods(Masterpass.prototype));\n analytics.sendEvent(self._client, \"masterpass.teardown-completed\");\n resolve();\n });\n };\n function hasMissingOption(options) {\n var i, option;\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_TOKENIZE.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_TOKENIZE[i];\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n return false;\n }\n module.exports = wrapPromise.wrapPrototype(Masterpass);\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/braintree-error\": 124,\n \"../../lib/constants\": 126,\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/convert-to-braintree-error\": 128,\n \"../../lib/frame-service/external\": 139,\n \"../../lib/methods\": 155,\n \"../shared/constants\": 169,\n \"../shared/errors\": 170,\n \"@braintree/wrap-promise\": 43\n }],\n 167: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /** @module braintree-web/masterpass\n * @description Processes Masterpass. *This component is currently in beta and is subject to change.*\n */\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var browserDetection = _dereq_(\"./shared/browser-detection\");\n var Masterpass = _dereq_(\"./external/masterpass\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var VERSION = \"3.101.1\";\n var errors = _dereq_(\"./shared/errors\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link Masterpass} instance. If no callback is passed in, the create function returns a promise that resolves the {@link Masterpass} instance.\n * @example\n * braintree.masterpass.create({\n * client: clientInstance\n * }, function (createErr, masterpassInstance) {\n * if (createErr) {\n * if (createErr.code === 'MASTERPASS_BROWSER_NOT_SUPPORTED') {\n * console.error('This browser is not supported.');\n * } else {\n * console.error('Error!', createErr);\n * }\n * return;\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"Masterpass\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n if (!isSupported()) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_BROWSER_NOT_SUPPORTED));\n }\n return Promise.resolve();\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var masterpassInstance, configuration;\n options.client = client;\n configuration = options.client.getConfiguration().gatewayConfiguration;\n if (!configuration.masterpass) {\n return Promise.reject(new BraintreeError(errors.MASTERPASS_NOT_ENABLED));\n }\n masterpassInstance = new Masterpass(options);\n return masterpassInstance._initialize();\n });\n }\n\n /**\n * @static\n * @function isSupported\n * @description Returns true if Masterpass supports this browser.\n * @example\n * if (braintree.masterpass.isSupported()) {\n * // Add Masterpass button to the page\n * } else {\n * // Hide Masterpass payment option\n * }\n * @returns {Boolean} Returns true if Masterpass supports this browser.\n */\n function isSupported() {\n return Boolean(window.popupBridge || browserDetection.supportsPopups());\n }\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./external/masterpass\": 166,\n \"./shared/browser-detection\": 168,\n \"./shared/errors\": 170,\n \"@braintree/wrap-promise\": 43\n }],\n 168: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n supportsPopups: _dereq_(\"@braintree/browser-detection/supports-popups\")\n };\n }, {\n \"@braintree/browser-detection/supports-popups\": 32\n }],\n 169: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n LANDING_FRAME_NAME: \"braintreemasterpasslanding\",\n POPUP_WIDTH: 450,\n POPUP_HEIGHT: 660,\n MASTERPASS_VERSION: \"v6\",\n REQUIRED_OPTIONS_FOR_TOKENIZE: [\"subtotal\", \"currencyCode\"]\n };\n }, {}],\n 170: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Masterpass - Creation Error Codes\n * @description Errors that occur when [creating the Masterpass component](./module-braintree-web_masterpass#.create).\n * @property {CUSTOMER} MASTERPASS_BROWSER_NOT_SUPPORTED Occurs when browser is not a supported browser for Masterpass.\n * @property {MERCHANT} MASTERPASS_NOT_ENABLED Occurs when Masterpass is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Masterpass - Tokenize Error Codes\n * @description Errors that occur when [tokenizing](./Masterpass.html#tokenize).\n * @property {MERCHANT} MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION Occurs when tokenize is called without a required option.\n * @property {MERCHANT} MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS Occurs if tokenization flow is initialized while another flow is already in progress.\n * @property {NETWORK} MASTERPASS_ACCOUNT_TOKENIZATION_FAILED Occurs when tokenization of Masterpass details fails.\n * @property {MERCHANT} MASTERPASS_POPUP_OPEN_FAILED Occurs when the popup fails to open.\n * @property {MERCHANT} MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS Occurs when Masterpass is missing required parameters for tokenization.\n * @property {CUSTOMER} MASTERPASS_POPUP_CLOSED Occurs when the popup is closed by the customer.\n * @property {MERCHANT} MASTERPASS_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is used to tokenize Masterpass.\n * @property {NETWORK} MASTERPASS_FLOW_FAILED Occurs when an error is returned from request to tokenize.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n MASTERPASS_BROWSER_NOT_SUPPORTED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"MASTERPASS_BROWSER_NOT_SUPPORTED\",\n message: \"Browser is not supported.\"\n },\n MASTERPASS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_NOT_ENABLED\",\n message: \"Masterpass is not enabled for this merchant.\"\n },\n MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for tokenize.\"\n },\n MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS\",\n message: \"Masterpass tokenization is already in progress.\"\n },\n MASTERPASS_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"MASTERPASS_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's Masterpass account.\"\n },\n MASTERPASS_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_POPUP_OPEN_FAILED\",\n message: \"Masterpass popup failed to open. Make sure to tokenize in response to a user action, such as a click.\"\n },\n MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS\",\n message: \"Masterpass popup failed to return all required parameters needed to continue tokenization.\"\n },\n MASTERPASS_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"MASTERPASS_POPUP_CLOSED\",\n message: \"Customer closed Masterpass popup before authorizing.\"\n },\n MASTERPASS_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_INVALID_PAYMENT_OPTION\",\n message: \"Masterpass payment options are invalid.\"\n },\n MASTERPASS_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"MASTERPASS_FLOW_FAILED\",\n message: \"Could not initialize Masterpass flow.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 171: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var analytics = _dereq_(\"../../lib/analytics\");\n var assign = _dereq_(\"../../lib/assign\").assign;\n var Bus = _dereq_(\"framebus\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var generateGooglePayConfiguration = _dereq_(\"../../lib/generate-google-pay-configuration\");\n var iFramer = _dereq_(\"@braintree/iframer\");\n var uuid = _dereq_(\"@braintree/uuid\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var methods = _dereq_(\"../../lib/methods\");\n var EventEmitter = _dereq_(\"@braintree/event-emitter\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var VERSION = \"3.101.1\";\n var constants = _dereq_(\"../shared/constants\");\n var events = constants.events;\n var errors = constants.errors;\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @typedef {object} PaymentRequestComponent~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.bin The BIN number of the card..\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} details.rawPaymentResponse The raw payment response from the payment request, with sensitive card details removed.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, `CreditCard` or `AndroidPayCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @typedef {object} PaymentRequestComponent~paymentRequestConfiguration\n * @property {object} configuration.details The payment details. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_payment_details).\n * @property {array} [configuration.supportedPaymentMethods] The supported payment methods. If not passed in, the supported payment methods from the merchant account that generated the authorization for the client will be used. For details on this array, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_supported_payment_methods).\n * @property {object} [configuration.options] Additional payment request options. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_options_optional).\n */\n\n /**\n * @typedef {object} PaymentRequestComponent~shippingEventObject\n * @description The event payload sent from {@link PaymentRequestComponent#on|on}.\n * @property {object} target An object which contains data about the event.\n * @property {function} updateWith A method to call with the updated Payment Request details.\n */\n\n /**\n * @name PaymentRequestComponent#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. `event` should be {@link PaymentRequestComponent#event:shippingAddressChange|shippingAddressChange} or {@link PaymentRequestComponent#event:shippingOptionChange|shippingOptionChange}. For convenience, you can also listen on `shippingaddresschange` or `shippingoptionchange` to match the event listeners in the [Payment Request API documentation](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request#shipping_in_payment_request_api). Events will emit a {@link PaymentRequestComponent~shippingEventObject|shippingEventObject}.\n * @example\n * Listening to a Payment Request event, in this case 'shippingAddressChange'\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * console.log(event.target.shippingAddress);\n * });\n * });\n * @returns {void}\n */\n\n /**\n * @name PaymentRequestComponent#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n * Subscribing and then unsubscribing from a Payment Request event, in this case 'shippingAddressChange'\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * var callback = function (event) {\n * console.log(event.target.shippingAddress);\n * };\n * paymentRequestInstance.on('shippingAddressChange', callback);\n *\n * // later on\n * paymentRequestInstance.off('shippingAddressChange', callback);\n * });\n * @returns {void}\n */\n\n /**\n * This event is emitted when the customer selects a shipping address.\n * @event PaymentRequestComponent#shippingAddressChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n * Listening to a shipping address change event\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate event.target.shippingAddress if needed\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\n /**\n * This event is emitted when the customer selects a shipping option.\n * @event PaymentRequestComponent#shippingOptionChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n * Listening to a shipping option change event\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * // validate event.target.shippingOption if needed\n *\n * paymentRequestDetails.shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\n var CARD_TYPE_MAPPINGS = {\n Visa: \"visa\",\n MasterCard: \"mastercard\",\n \"American Express\": \"amex\",\n \"Diners Club\": \"diners\",\n Discover: \"discover\",\n JCB: \"jcb\",\n UnionPay: \"unionpay\",\n Maestro: \"maestro\"\n };\n var BRAINTREE_GOOGLE_PAY_MERCHANT_ID = \"18278000977346790994\";\n function composeUrl(assetsUrl, componentId, isDebug) {\n var baseUrl = assetsUrl;\n\n // endRemoveIf(production)\n\n return baseUrl + \"/web/\" + VERSION + \"/html/payment-request-frame\" + useMin(isDebug) + \".html#\" + componentId;\n }\n\n /**\n * @class PaymentRequestComponent\n * @param {object} options The Payment Request Component {@link module:braintree-web/payment-request.create create} options.\n * @description Do not use this constructor directly. Use {@link module:braintree-web/payment-request.create|braintree-web.payment-request.create} instead.\n *\n * @classdesc This class represents a Payment Request component produced by {@link module:braintree-web/payment-request.create|braintree-web/payment-request.create}. Instances of this class have methods for initializing a Payment Request.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/main/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n */\n function PaymentRequestComponent(options) {\n var enabledPaymentMethods = options.enabledPaymentMethods || {};\n EventEmitter.call(this);\n this._componentId = uuid();\n this._client = options.client;\n this._enabledPaymentMethods = {\n basicCard: enabledPaymentMethods.basicCard !== false,\n googlePay: enabledPaymentMethods.googlePay !== false\n };\n this._googlePayVersion = options.googlePayVersion === 2 ? 2 : 1;\n this._googleMerchantId = BRAINTREE_GOOGLE_PAY_MERCHANT_ID;\n this._supportedPaymentMethods = this._constructDefaultSupportedPaymentMethods();\n this._defaultSupportedPaymentMethods = Object.keys(this._supportedPaymentMethods).map(function (key) {\n return this._supportedPaymentMethods[key];\n }.bind(this));\n this._bus = new Bus({\n channel: this._componentId\n });\n }\n EventEmitter.createChild(PaymentRequestComponent);\n PaymentRequestComponent.prototype._constructDefaultSupportedPaymentMethods = function () {\n var configuration = this._client.getConfiguration();\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var cardConfiguration = configuration.gatewayConfiguration.creditCards;\n var supportedPaymentMethods = {};\n if (this._enabledPaymentMethods.basicCard && cardConfiguration && cardConfiguration.supportedCardTypes.length > 0) {\n supportedPaymentMethods.basicCard = {\n supportedMethods: \"basic-card\",\n data: {\n supportedNetworks: cardConfiguration.supportedCardTypes.reduce(function (types, cardType) {\n if (cardType in CARD_TYPE_MAPPINGS) {\n types.push(CARD_TYPE_MAPPINGS[cardType]);\n }\n return types;\n }, [])\n }\n };\n }\n if (this._enabledPaymentMethods.googlePay && androidPayConfiguration && androidPayConfiguration.enabled) {\n supportedPaymentMethods.googlePay = {\n supportedMethods: \"https://google.com/pay\",\n data: generateGooglePayConfiguration(configuration, this._googlePayVersion, this._googleMerchantId)\n };\n }\n return supportedPaymentMethods;\n };\n PaymentRequestComponent.prototype.initialize = function () {\n var clientConfiguration = this._client.getConfiguration();\n var self = this;\n this._frame = iFramer({\n allowPaymentRequest: true,\n name: \"braintree-payment-request-frame\",\n class: \"braintree-payment-request-frame\",\n height: 0,\n width: 0,\n style: {\n position: \"absolute\",\n left: \"-9999px\"\n },\n title: \"Secure Payment Frame\"\n });\n if (this._defaultSupportedPaymentMethods.length === 0) {\n return Promise.reject(new BraintreeError(errors.PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS));\n }\n return new Promise(function (resolve) {\n self._bus.on(events.FRAME_READY, function (reply) {\n reply(self._client);\n });\n self._bus.on(events.FRAME_CAN_MAKE_REQUESTS, function () {\n analytics.sendEvent(self._client, \"payment-request.initialized\");\n self._bus.on(events.SHIPPING_ADDRESS_CHANGE, function (shippingAddress) {\n var shippingAddressChangeEvent = {\n target: {\n shippingAddress: shippingAddress\n },\n updateWith: function (paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_ADDRESS, paymentDetails);\n }\n };\n self._emit(\"shippingAddressChange\", shippingAddressChangeEvent);\n self._emit(\"shippingaddresschange\", shippingAddressChangeEvent);\n });\n self._bus.on(events.SHIPPING_OPTION_CHANGE, function (shippingOption) {\n var shippingOptionChangeEvent = {\n target: {\n shippingOption: shippingOption\n },\n updateWith: function (paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_OPTION, paymentDetails);\n }\n };\n self._emit(\"shippingOptionChange\", shippingOptionChangeEvent);\n self._emit(\"shippingoptionchange\", shippingOptionChangeEvent);\n });\n resolve(self);\n });\n\n // TODO - We may need to apply the same setTimeout hack that Hosted Fields\n // uses for iframes to load correctly in Edge. See:\n // https://github.com/braintree/braintree-web/blob/0c951e5f9859c606652485de14188b6bd6656677/src/hosted-fields/external/hosted-fields.js#L449-L469\n self._frame.src = composeUrl(clientConfiguration.gatewayConfiguration.assetsUrl, self._componentId, clientConfiguration.isDebug);\n document.body.appendChild(self._frame);\n });\n };\n\n /**\n * Create an object to pass into tokenize to specify a custom configuration. If no overrides are provided, the default configuration will be provided.\n * @public\n * @param {string} type The supported payment method type. Possible values are `basicCard` and `googlePay`.\n * If no type is provided, the function will throw an error. If the type provided is not an enabled payment method for the merchant account , the function will throw an error.\n * @param {object} [overrides] The configuration overrides for the [data property on the supported payment methods objects](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request). If not passed in, the default configuration for the specified type will be provided. If a property is not provided, the value from the default configuration will be used.\n * @example Getting the default configuration for a specified type\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard');\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa', 'mastercard', 'amex'] <- whatever the supported card networks for the merchant account are\n * @example Specifying overrides\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa'],\n * supportedTypes: ['credit', 'debit']\n * });\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa']\n * configuration.data.supportedTypes; // ['credit', 'debit']\n * @returns {object} Returns a configuration object for use in the tokenize function.\n */\n PaymentRequestComponent.prototype.createSupportedPaymentMethodsConfiguration = function (type, overrides) {\n var configuration;\n if (!type) {\n throw new BraintreeError(errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE);\n }\n if (!this._enabledPaymentMethods[type]) {\n throw new BraintreeError(errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED);\n }\n configuration = assign({}, this._supportedPaymentMethods[type]);\n configuration.data = assign({}, configuration.data, overrides);\n return configuration;\n };\n\n /**\n * Tokenizes a Payment Request\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] The second argument, data, is a {@link PaymentRequest~paymentPayload|paymentPayload}. If no callback is provided, `tokenize` returns a function that resolves with a {@link PaymentRequestComponent~tokenizePayload|tokenizePayload}.\n * @example\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to server\n *\n * // examine the raw response (with card details removed for security) from the payment request\n * console.log(payload.details.rawPaymentResponse);\n * }).catch(function (err) {\n * if (err.code === 'PAYMENT_REQUEST_CANCELED') {\n * // payment request was canceled by user\n * } else {\n * // an error occurred while processing\n * }\n * });\n * @example Tokenize only Visa cards\n * var basicCardConfiguration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa']\n * };\n *\n * paymentRequestInstance.tokenize({\n * supportedPaymentMethods: [basicCardConfiguration],\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * });\n * @example Include payment request options\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * },\n * options: {\n * requestPayerName: true,\n * requestPayerPhone: true,\n * requestPayerEmail: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect additional info from the raw response\n * console.log(payload.details.rawPaymentResponse);\n * });\n * @example Request Shipping Information\n * var shippingOptions = [\n * {\n * id: 'economy',\n * label: 'Economy Shipping (5-7 Days)',\n * amount: {\n * currency: 'USD',\n * value: '0',\n * },\n * }, {\n * id: 'express',\n * label: 'Express Shipping (2-3 Days)',\n * amount: {\n * currency: 'USD',\n * value: '5',\n * },\n * }, {\n * id: 'next-day',\n * label: 'Next Day Delivery',\n * amount: {\n * currency: 'USD',\n * value: '12',\n * },\n * },\n * ];\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * },\n * shippingOptions: shippingOptions\n * };\n *\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate shipping address on event.target.shippingAddress\n * // make changes to the paymentDetails or shippingOptions if necessary\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.tokenize({\n * details: paymentDetails,\n * options: {\n * requestShipping: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect shipping information from payload\n * console.log(payload.details.rawPaymentResponse.shippingAddress);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PaymentRequestComponent.prototype.tokenize = function (configuration) {\n var self = this;\n\n // NEXT_MAJOR_VERSION fail early if a payment method is passed in\n // that the component does not support\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.PAYMENT_REQUEST_INITIALIZED, {\n supportedPaymentMethods: configuration.supportedPaymentMethods || self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options\n }, function (response) {\n var rawError = response[0];\n var payload = response[1];\n if (rawError) {\n reject(self._formatTokenizationError(rawError));\n return;\n }\n analytics.sendEvent(self._client, \"payment-request.tokenize.succeeded\");\n resolve({\n nonce: payload.nonce,\n type: payload.type,\n description: payload.description,\n details: {\n rawPaymentResponse: payload.details.rawPaymentResponse,\n cardType: payload.details.cardType,\n lastFour: payload.details.lastFour,\n lastTwo: payload.details.lastTwo\n },\n binData: payload.binData\n });\n });\n });\n };\n\n /**\n * Check if the customer can make payments.\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] Called on completion.\n * @example\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * }\n * };\n *\n * paymentRequestInstance.canMakePayment({\n * details: paymentDetails\n * }).then(function (result) {\n * if (result) {\n * // set up payment request button\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PaymentRequestComponent.prototype.canMakePayment = function (configuration) {\n var self = this;\n var unsupportedPaymentMethod;\n\n // NEXT_MAJOR_VERSION Move this check to component creation\n if (!window.PaymentRequest) {\n analytics.sendEvent(self._client, \"payment-request.can-make-payment.not-available\");\n return Promise.resolve(false);\n }\n if (configuration.supportedPaymentMethods) {\n configuration.supportedPaymentMethods.forEach(function (config) {\n var supportedMethods = config.supportedMethods;\n if (!(supportedMethods in constants.SUPPORTED_METHODS)) {\n unsupportedPaymentMethod = supportedMethods;\n }\n });\n if (unsupportedPaymentMethod) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.type,\n code: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.code,\n message: unsupportedPaymentMethod + \" is not a supported payment method.\"\n }));\n }\n }\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.CAN_MAKE_PAYMENT, {\n supportedPaymentMethods: configuration.supportedPaymentMethods || self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options\n }, function (response) {\n var error = response[0];\n var payload = response[1];\n if (error) {\n reject(self._formatCanMakePaymentError(error));\n return;\n }\n analytics.sendEvent(self._client, \"payment-request.can-make-payment.\" + payload);\n resolve(payload);\n });\n });\n };\n\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/payment-request.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paymentRequestInstance.teardown();\n * @example With callback\n * paymentRequestInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PaymentRequestComponent.prototype.teardown = function () {\n this._bus.teardown();\n this._frame.parentNode.removeChild(this._frame);\n convertMethodsToError(this, methods(PaymentRequestComponent.prototype));\n analytics.sendEvent(this._client, \"payment-request.teardown-completed\");\n return Promise.resolve();\n };\n PaymentRequestComponent.prototype._formatTokenizationError = function (error) {\n var formattedError;\n switch (error.name) {\n case \"AbortError\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CANCELED.type,\n code: errors.PAYMENT_REQUEST_CANCELED.code,\n message: errors.PAYMENT_REQUEST_CANCELED.message,\n details: {\n originalError: error\n }\n });\n analytics.sendEvent(this._client, \"payment-request.tokenize.canceled\");\n return formattedError;\n case \"PAYMENT_REQUEST_INITIALIZATION_FAILED\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error\n }\n });\n break;\n case \"BRAINTREE_GATEWAY_GOOGLE_PAYMENT_TOKENIZATION_ERROR\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.code,\n message: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.message,\n details: {\n originalError: error\n }\n });\n break;\n case \"BRAINTREE_GATEWAY_GOOGLE_PAYMENT_PARSING_ERROR\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.code,\n message: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.message,\n details: {\n originalError: error\n }\n });\n break;\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_NOT_COMPLETED.code,\n type: error.type || BraintreeError.types.CUSTOMER,\n message: errors.PAYMENT_REQUEST_NOT_COMPLETED.message,\n details: {\n originalError: error\n }\n });\n }\n analytics.sendEvent(this._client, \"payment-request.tokenize.failed\");\n return formattedError;\n };\n PaymentRequestComponent.prototype._formatCanMakePaymentError = function (error) {\n var formattedError;\n switch (error.name) {\n case \"PAYMENT_REQUEST_INITIALIZATION_FAILED\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error\n }\n });\n break;\n case \"NotAllowedError\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.type,\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.code,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.message,\n details: {\n originalError: error\n }\n });\n break;\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.code,\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.type,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.message,\n details: {\n originalError: error\n }\n });\n }\n analytics.sendEvent(this._client, \"payment-request.can-make-payment.failed\");\n return formattedError;\n };\n module.exports = wrapPromise.wrapPrototype(PaymentRequestComponent);\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/assign\": 121,\n \"../../lib/braintree-error\": 124,\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/generate-google-pay-configuration\": 149,\n \"../../lib/methods\": 155,\n \"../../lib/use-min\": 160,\n \"../shared/constants\": 173,\n \"@braintree/event-emitter\": 33,\n \"@braintree/iframer\": 35,\n \"@braintree/uuid\": 39,\n \"@braintree/wrap-promise\": 43,\n \"framebus\": 52\n }],\n 172: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/payment-request\n * @description A component to integrate with the Payment Request API.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/main/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n * */\n var PaymentRequestComponent = _dereq_(\"./external/payment-request\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var VERSION = \"3.101.1\";\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {object} [options.enabledPaymentMethods] An object representing which payment methods to display.\n * @param {boolean} [options.enabledPaymentMethods.basicCard=true] Whether or not to display credit card as an option in the Payment Request dialog. If left blank or set to true, credit cards will be displayed in the dialog if the merchant account is set up to process credit cards.\n * @param {boolean} [options.enabledPaymentMethods.googlePay=true] Whether or not to display Google Pay as an option in the Payment Request dialog. If left blank or set to true, Google Pay will be displayed in the dialog if the merchant account is set up to process Google Pay.\n * @param {Number} [options.googlePayVersion=1] Ignored if `options.enabledPaymentMethods.googlePay = false`. If `true`, this option specifies the version of Google Pay to use. Choose either 1 (default) or 2.\n * @param {callback} [callback] The second argument, `data`, is the {@link PaymentRequestComponent} instance. If no callback is provided, `create` returns a promise that resolves with the {@link PaymentRequestComponent} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * if (window.PaymentRequest) {\n * braintree.paymentRequest.create({\n * client: clientInstance\n * }, cb);\n * } else {\n * // fall back to Hosted Fields if browser does not support Payment Request API\n * braintree.hostedFields.create(hostedFieldsOptions, cb);\n * }\n * @example Explicitly turning off credit cards from Payment Request API dialog\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * googlePay: true,\n * basicCard: false\n * }\n * }, cb);\n * @example Using Google Pay v2 or basic card\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * basicCard: true,\n * googlePay: true\n * },\n * googlePayVersion: 2\n * }, cb);\n *\n */\n function create(options) {\n var name = \"Payment Request\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var paymentRequestInstance;\n options.client = client;\n paymentRequestInstance = new PaymentRequestComponent(options);\n return paymentRequestInstance.initialize();\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./external/payment-request\": 171,\n \"@braintree/wrap-promise\": 43\n }],\n 173: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var enumerate = _dereq_(\"../../lib/enumerate\");\n var errors = _dereq_(\"./errors\");\n var constants = {};\n constants.events = enumerate([\"CAN_MAKE_PAYMENT\", \"FRAME_READY\", \"FRAME_CAN_MAKE_REQUESTS\", \"PAYMENT_REQUEST_INITIALIZED\", \"SHIPPING_ADDRESS_CHANGE\", \"UPDATE_SHIPPING_ADDRESS\", \"SHIPPING_OPTION_CHANGE\", \"UPDATE_SHIPPING_OPTION\"], \"payment-request:\");\n constants.errors = errors;\n constants.SUPPORTED_METHODS = {\n \"basic-card\": true,\n \"https://google.com/pay\": true\n };\n module.exports = constants;\n }, {\n \"../../lib/enumerate\": 134,\n \"./errors\": 174\n }],\n 174: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Payment Request - Creation Error Codes\n * @description Errors that occur when [creating the Payment Request component](./module-braintree-web_payment-request.html#.create).\n * @property {MERCHANT} PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS Occurs when there are no valid payment methods configured.\n */\n\n /**\n * @name BraintreeError.Payment Request - createSupportedPaymentMethodsConfiguration Error Codes\n * @description Errors that occur when using the [`createSupportedPaymentMethodsConfiguration` method](./PaymentRequestComponent.html#createSupportedPaymentMethodsConfiguration)\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE Occurs when no type is supplied for method.\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED Occurs when configured type is not enabled.\n */\n\n /**\n * @name BraintreeError.Payment Request - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PaymentRequestComponent.html#tokenize)\n * @property {CUSTOMER} PAYMENT_REQUEST_CANCELED Occurs when customer cancels the Payment Request.\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is closed do to the options being misconfigured.\n * @property {MERCHANT} PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE Occurs when a Google Payment payment method is unable to be tokenized.\n * @property {UNKNOWN} PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR Occurs when the result of tokenizing a Google Payment payment method could not be parsed.\n * @property {CUSTOMER} PAYMENT_REQUEST_NOT_COMPLETED Occurs when an error prevented the Payment Request from being completed.\n */\n\n /**\n * @name BraintreeError.Payment Request - canMakePayment Error Codes\n * @description Errors that occur when using the [`canMakePayment` method](./PaymentRequestComponent.html#canMakePayment)\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is instantiated with misconfigured options.\n * @property {MERCHANT} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED Occurs when `canMakePayment` results in a `DomException` with a `NotAllowedError`. This usually occurs when `canMakePayment` is called multiple times with different supported payment options.\n * @property {MERCHANT} PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD Occurs when `canMakePayment` is called with a `supportedPaymentMethods` array that contains a payment method that is not supported by the Braintree SDK.\n * @property {UNKNOWN} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED Occurs when `canMakePayment` fails for any reason other than a misconfigured Payment Request object.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS\",\n message: \"There are no supported payment methods associated with this account.\"\n },\n PAYMENT_REQUEST_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYMENT_REQUEST_CANCELED\",\n message: \"Payment request was canceled.\"\n },\n PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED\",\n message: \"Something went wrong when configuring the payment request.\"\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED\",\n message: \"Something went wrong when calling `canMakePayment`\"\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED\",\n message: \"Something went wrong when calling `canMakePayment`. Most likely, `canMakePayment` was called multiple times with different supportedMethods configurations.\"\n },\n PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD\"\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE\",\n message: \"Something went wrong when tokenizing the Google Pay card.\"\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR\",\n message: \"Something went wrong when tokenizing the Google Pay card.\"\n },\n PAYMENT_REQUEST_NOT_COMPLETED: {\n code: \"PAYMENT_REQUEST_NOT_COMPLETED\",\n message: \"Payment request could not be completed.\"\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE\",\n message: \"createSupportedPaymentMethodsConfiguration must include a type parameter.\"\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED\",\n message: \"createSupportedPaymentMethodsConfiguration type parameter must be valid or enabled.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 175: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.PayPal Checkout - Creation Error Codes\n * @description Errors that occur when [creating the PayPal Checkout component](./module-braintree-web_paypal-checkout.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n * @property {MERCHANT} PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED Occurs only when testing in Sandbox, when a PayPal sandbox account is not linked to the merchant account in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - createPayment Error Codes\n * @description Errors that occur when using the [`createPayment` method](./PayPalCheckout.html#createPayment).\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when a required option is missing.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an option contains an invalid value.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when something goes wrong when initializing the flow.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - startVaultInitiatedCheckout Error Codes\n * @description Errors that occur when using the [`startVaultInitiatedCheckout` method](./PayPalCheckout.html#startVaultInitiatedCheckout).\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED Occurs when a required param is missing when calling the method.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened. This often occurs because the call to start the vault initiated flow was not triggered from a click event.\n * @property {CUSTOMER} PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED Occurs when a customer closes the PayPal flow before completion.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS Occurs when the flow is initialized while an authorization is already in progress.\n * @property {NETWORK} PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED Occurs when something went wrong setting up the flow.\n */\n\n /**\n * @name BraintreeError.PayPal Checkout - tokenizePayment Error Codes\n * @description Errors that occur when using the [`tokenizePayment` method](./PayPalCheckout.html#tokenizePayment).\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n */\n\n /**\n * @name BraintreeError.Paypal Checkout - updatePayment Error Codes\n * @description Errors that occur when using the [`updatePayment` method](./PayPalCheckout.html#updatePayment).\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an option contains an invalid value.\n * @property {MERCHANT} PAYPAL_MISSING_REQUIRED_OPTION Occurs when a required option is missing.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when something goes wrong when initializing the flow or communicating with the server.\n */\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n module.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_NOT_ENABLED\",\n message: \"PayPal is not enabled for this merchant.\"\n },\n PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED\",\n message: \"A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developer.paypal.com/braintree/docs/guides/paypal/testing-go-live#linked-paypal-testing for details on linking your PayPal sandbox with Braintree.\"\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's PayPal account.\"\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_FLOW_FAILED\",\n message: \"Could not initialize PayPal flow.\"\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_FLOW_OPTION_REQUIRED\",\n message: \"PayPal flow property is invalid or missing.\"\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED\"\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED\",\n message: \"Something went wrong when setting up the checkout workflow.\"\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED\",\n message: \"PayPal popup failed to open, make sure to initiate the vault checkout in response to a user action.\"\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED\",\n message: \"Customer closed PayPal popup before authorizing.\"\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS\",\n message: \"Vault initiated checkout already in progress.\"\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_INVALID_PAYMENT_OPTION\",\n message: \"PayPal payment options are invalid.\"\n },\n PAYPAL_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option.\"\n }\n };\n }, {\n \"../lib/braintree-error\": 124\n }],\n 176: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/paypal-checkout\n * @description A component to integrate with the [PayPal JS SDK](https://github.com/paypal/paypal-checkout-components).\n */\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var PayPalCheckout = _dereq_(\"./paypal-checkout\");\n var VERSION = \"3.101.1\";\n\n /**\n * @static\n * @function create\n * @description There are two ways to integrate the PayPal Checkout component. See the [PayPal Checkout constructor documentation](PayPalCheckout.html#PayPalCheckout) for more information and examples.\n *\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization.\n * @param {boolean} [options.autoSetDataUserIdToken=false] Whether or not to render the PayPal SDK button with a customer's vaulted PayPal account. Must be used in conjunction with a Client Token generated with a customer id.\n * @param {callback} [callback] The second argument, `data`, is the {@link PayPalCheckout} instance.\n * @example\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * // set up the PayPal JS SDK\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"PayPal Checkout\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var instance = new PayPalCheckout(options);\n return instance._initialize(options);\n });\n }\n\n /**\n * @static\n * @function isSupported\n * @description Returns true if PayPal Checkout [supports this browser](index.html#browser-support-webviews).\n * @deprecated Previously, this method checked for Popup support in the browser. The PayPal JS SDK now falls back to a modal if popups are not supported.\n * @returns {Boolean} Returns true if PayPal Checkout supports this browser.\n */\n function isSupported() {\n return true;\n }\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"./paypal-checkout\": 177,\n \"@braintree/wrap-promise\": 43\n }],\n 177: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var analytics = _dereq_(\"../lib/analytics\");\n var assign = _dereq_(\"../lib/assign\").assign;\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var convertToBraintreeError = _dereq_(\"../lib/convert-to-braintree-error\");\n var errors = _dereq_(\"./errors\");\n var constants = _dereq_(\"../paypal/shared/constants\");\n var frameService = _dereq_(\"../lib/frame-service/external\");\n var createAuthorizationData = _dereq_(\"../lib/create-authorization-data\");\n var methods = _dereq_(\"../lib/methods\");\n var useMin = _dereq_(\"../lib/use-min\");\n var convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\n var querystring = _dereq_(\"../lib/querystring\");\n var VERSION = \"3.101.1\";\n var INTEGRATION_TIMEOUT_MS = _dereq_(\"../lib/constants\").INTEGRATION_TIMEOUT_MS;\n var REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT = [\"amount\", \"currency\", \"vaultInitiatedCheckoutPaymentMethodToken\"];\n var PAYPAL_SDK_PRELOAD_URL = \"https://www.{ENV}paypal.com/smart/buttons/preload\";\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n /**\n * PayPal Checkout tokenized payload. Returned in {@link PayPalCheckout#tokenizePayment}'s callback as the second argument, `data`.\n * @typedef {object} PayPalCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact support](https://developer.paypal.com/braintree/help) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @property {object} creditFinancingOffered.totalCost This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal-checkout.create|paypal-checkout.create}\n * @classdesc This class represents a PayPal Checkout component that coordinates with the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. Instances of this class can generate payment data and tokenize authorized payments.\n *\n * All UI (such as preventing actions on the parent page while authentication is in progress) is managed by the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. You must provide your PayPal `client-id` as a query parameter. You can [retrieve this value from the PayPal Dashboard](https://developer.paypal.com/docs/checkout/integrate/#1-get-paypal-rest-api-credentials).\n * @description Do not use this constructor directly. Use {@link module:braintree-web/paypal-checkout.create|braintree-web.paypal-checkout.create} instead.\n *\n * #### Integrate Checkout Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * \n *
\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createOrder: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * currency: 'USD',\n * amount: '10.00',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate Vault Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * \n *
\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate with Checkout.js (deprecated PayPal SDK)\n *\n * If you are creating a new PayPal integration, please follow the previous integration guide to use the current version of the PayPal SDK. Use this integration guide only as a reference if you are already integrated with Checkout.js.\n *\n * You must have PayPal's Checkout.js script loaded on your page.\n *\n * ```html\n * \n * ```\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production', // or 'sandbox'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * // your createPayment options here\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n */\n function PayPalCheckout(options) {\n this._merchantAccountId = options.merchantAccountId;\n // TODO remove this requirement for it to be opt in.\n // This feature is not yet GA, so we're intentionally making\n // it opt in and not publicly documenting it yet. Once it's\n // GA, we can remove the requirement to opt in to it\n this._autoSetDataUserIdToken = Boolean(options.autoSetDataUserIdToken);\n }\n PayPalCheckout.prototype._initialize = function (options) {\n var config;\n if (options.client) {\n config = options.client.getConfiguration();\n this._authorizationInformation = {\n fingerprint: config.authorizationFingerprint,\n environment: config.gatewayConfiguration.environment\n };\n } else {\n config = createAuthorizationData(options.authorization);\n this._authorizationInformation = {\n fingerprint: config.attrs.authorizationFingerprint,\n environment: config.environment\n };\n }\n this._clientPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: \"PayPal Checkout\"\n }).then(function (client) {\n this._configuration = client.getConfiguration();\n\n // we skip these checks if a merchant account id is\n // passed in, because the default merchant account\n // may not have paypal enabled\n if (!this._merchantAccountId) {\n if (!this._configuration.gatewayConfiguration.paypalEnabled) {\n this._setupError = new BraintreeError(errors.PAYPAL_NOT_ENABLED);\n } else if (this._configuration.gatewayConfiguration.paypal.environmentNoNetwork === true) {\n this._setupError = new BraintreeError(errors.PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED);\n }\n }\n if (this._setupError) {\n return Promise.reject(this._setupError);\n }\n analytics.sendEvent(client, \"paypal-checkout.initialized\");\n this._frameServicePromise = this._setupFrameService(client);\n return client;\n }.bind(this));\n\n // if client was passed in, let config checks happen before\n // resolving the instance. Otherwise, just resolve the instance\n if (options.client) {\n return this._clientPromise.then(function () {\n return this;\n }.bind(this));\n }\n return Promise.resolve(this);\n };\n PayPalCheckout.prototype._setupFrameService = function (client) {\n var frameServicePromise = new ExtendedPromise();\n var config = client.getConfiguration();\n var timeoutRef = setTimeout(function () {\n analytics.sendEvent(client, \"paypal-checkout.frame-service.timed-out\");\n frameServicePromise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED));\n }, INTEGRATION_TIMEOUT_MS);\n this._assetsUrl = config.gatewayConfiguration.paypal.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = config.isDebug;\n // Note: this is using the static landing frame that the deprecated PayPal component builds and uses\n this._loadingFrameUrl = this._assetsUrl + \"/html/paypal-landing-frame\" + useMin(this._isDebug) + \".html\";\n frameService.create({\n name: \"braintreepaypallanding\",\n dispatchFrameUrl: this._assetsUrl + \"/html/dispatch-frame\" + useMin(this._isDebug) + \".html\",\n openFrameUrl: this._loadingFrameUrl\n }, function (service) {\n this._frameService = service;\n clearTimeout(timeoutRef);\n frameServicePromise.resolve();\n }.bind(this));\n return frameServicePromise;\n };\n\n /**\n * @typedef {object} PayPalCheckout~lineItem\n * @property {string} quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} name Item name. Maximum 127 characters.\n * @property {string} kind Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.\n * @property {?string} unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {?string} description Item description. Maximum 127 characters.\n * @property {?string} productCode Product or UPC code for the item. Maximum 127 characters.\n * @property {?string} url The URL to product information.\n */\n\n /**\n * @typedef {object} PayPalCheckout~shippingOption\n * @property {string} id A unique ID that identifies a payer-selected shipping option.\n * @property {string} label A description that the payer sees, which helps them choose an appropriate shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yōuxiān fā huò`. Localize this description to the payer's locale.\n * @property {boolean} selected If `selected = true` is specified as part of the API request it represents the shipping option that the payee/merchant expects to be pre-selected for the payer when they first view the shipping options within the PayPal checkout experience. As part of the response if a shipping option has `selected = true` it represents the shipping option that the payer selected during the course of checkout with PayPal. Only 1 `shippingOption` can be set to `selected = true`.\n * @property {string} type The method by which the payer wants to get their items. The possible values are:\n * * `SHIPPING` - The payer intends to receive the items at a specified address.\n * * `PICKUP` - The payer intends to pick up the items at a specified address. For example, a store address.\n * @property {object} amount The shipping cost for the selected option.\n * @property {string} amount.currency The three-character ISO-4217 currency code. PayPal does not support all currencies.\n * @property {string} amount.value The amount the shipping option will cost. Includes the specified number of digits after decimal separator for the ISO-4217 currency code.\n */\n\n /**\n * Creates a PayPal payment ID or billing token using the given options. This is meant to be passed to the PayPal JS SDK.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @param {object} options All options for the PayPalCheckout component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer ID, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `capture` - Payment will be immediately submitted for settlement upon creating a transaction. `sale` can be used as an alias for this value.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow. Should not include shipping cost.\n * * Supports up to 2 digits after the decimal point\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {boolean} [options.requestBillingAgreement] If `true` and `flow = checkout`, the customer will be prompted to consent to a billing agreement during the checkout flow. This value is ignored when `flow = vault`.\n * @param {object} [options.billingAgreementDetails] When `requestBillingAgreement = true`, allows for details to be set for the billing agreement portion of the flow.\n * @param {string} [options.billingAgreementDetails.description] Description of the billing agreement to display to the customer.\n * @param {string} [options.vaultInitiatedCheckoutPaymentMethodToken] Use the payment method nonce representing a PayPal account with a Billing Agreement ID to create the payment and redirect the customer to select a new financial instrument. This option is only applicable to the `checkout` flow.\n * @param {shippingOption[]} [options.shippingOptions] List of shipping options offered by the payee or merchant to the payer to ship or pick up their items.\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.\n * @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.\n * @example\n * // this paypal object is created by the PayPal JS SDK\n * // see https://github.com/paypal/paypal-checkout-components\n * paypal.Buttons({\n * createOrder: function () {\n * // when createPayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * });\n * },\n * // Add other options, e.g. onApproved, onCancel, onError\n * }).render('#paypal-button');\n *\n * @example\n * // shippingOptions are passed to createPayment. You can review the result from onAuthorize to determine which shipping option id was selected.\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * shippingOptions: [\n * {\n * id: 'UUID-9',\n * type: 'PICKUP',\n * label: 'Store Location Five',\n * selected: true,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-fast',\n * type: 'SHIPPING',\n * label: 'Fast Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-slow',\n * type: 'SHIPPING',\n * label: 'Slow Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * }\n * ]\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.createPayment = function (options) {\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n return Promise.reject(new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED));\n }\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.createPayment\");\n return this._createPaymentResource(options).then(function (response) {\n var flowToken, urlParams;\n if (options.flow === \"checkout\") {\n urlParams = querystring.parse(response.paymentResource.redirectUrl);\n flowToken = urlParams.token;\n } else {\n flowToken = response.agreementSetup.tokenId;\n }\n return flowToken;\n });\n };\n PayPalCheckout.prototype._createPaymentResource = function (options, config) {\n var self = this;\n var endpoint = \"paypal_hermes/\" + constants.FLOW_ENDPOINTS[options.flow];\n delete this.intentFromCreatePayment;\n config = config || {};\n if (options.offerCredit === true) {\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.credit.offered\");\n }\n return this._clientPromise.then(function (client) {\n return client.request({\n endpoint: endpoint,\n method: \"post\",\n data: self._formatPaymentResourceData(options, config)\n }).then(function (data) {\n self.intentFromCreatePayment = options.intent;\n return data;\n });\n }).catch(function (err) {\n var status;\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n status = err.details && err.details.httpStatus;\n if (status === 422) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n }\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message\n }));\n });\n };\n\n /**\n * Use this function to update {@link PayPalCheckout~lineItem|line items} and/or {@link PayPalCheckout~shippingOption|shipping options} associated with a PayPalCheckout flow (`paymentId`).\n * When a {@link callback} is defined, this function returns undefined and invokes the callback. The second callback argument, data, is the returned server data. If no callback is provided, `updatePayment` returns a promise that resolves with the server data.\n * @public\n * @param {object} options All options for the PayPalCheckout component.\n * @param {string} options.paymentId This should be PayPal `paymentId`.\n * @param {(string|number)} options.amount The amount of the transaction, including the amount of the selected shipping option, and all `line_items`.\n * * Supports up to 2 decimal digits.\n * @param {string} options.currency The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {shippingOption[]} [options.shippingOptions] List of {@link PayPalCheckout~shippingOption|shipping options} offered by the payee or merchant to the payer to ship or pick up their items.\n * @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.\n * @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.\n * @example\n * // this paypal object is created by the PayPal JS SDK\n * // see https://github.com/paypal/paypal-checkout-components\n * paypal.Buttons({\n * createOrder: function () {\n * // when createPayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.createPayment({\n * //\n * });\n * },\n * onShippingChange: function (data) {\n * // Examine data and determine if the payment needs to be updated.\n * // when updatePayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.updatePayment({\n * paymentId: data.paymentId,\n * amount: '15.00',\n * currency: 'USD',\n * shippingOptions: [\n * {\n * id: 'shipping-speed-fast',\n * type: 'SHIPPING',\n * label: 'Fast Shipping',\n * selected: true,\n * amount: {\n * value: '5.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-slow',\n * type: 'SHIPPING',\n * label: 'Slow Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * }\n * ]\n * });\n * }\n * // Add other options, e.g. onApproved, onCancel, onError\n * }).render('#paypal-button');\n *\n * ```\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.updatePayment = function (options) {\n var self = this;\n var endpoint = \"paypal_hermes/patch_payment_resource\";\n if (!options || this._hasMissingOption(options, constants.REQUIRED_OPTIONS)) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.updatePayment.missing-options\");\n return Promise.reject(new BraintreeError(errors.PAYPAL_MISSING_REQUIRED_OPTION));\n }\n if (!this._verifyConsistentCurrency(options)) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.updatePayment.inconsistent-currencies\");\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: new Error(\"One or more shipping option currencies differ from checkout currency.\")\n }\n }));\n }\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.updatePayment\");\n return this._clientPromise.then(function (client) {\n return client.request({\n endpoint: endpoint,\n method: \"post\",\n data: self._formatUpdatePaymentData(options)\n });\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n if (status === 422) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.updatePayment.invalid\");\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n }\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.updatePayment.\" + errors.PAYPAL_FLOW_FAILED.code);\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message\n }));\n });\n };\n\n /**\n * Initializes the PayPal checkout flow with a payment method nonce that represents a vaulted PayPal account.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @ignore\n * @param {object} options These options are identical to the {@link PayPalCheckout#createPayment|options for creating a payment resource}, except for the following:\n * * `flow` cannot be set (will always be `'checkout'`)\n * * `amount`, `currency`, and `vaultInitiatedCheckoutPaymentMethodToken` are required instead of optional\n * * Additional configuration is available (listed below)\n * @param {boolean} [options.optOutOfModalBackdrop=false] By default, the webpage will darken and become unusable while the PayPal window is open. For full control of the UI, pass `true` for this option.\n * @param {callback} [callback] The second argument, payload, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example\n * paypalCheckoutInstance.startVaultInitiatedCheckout({\n * vaultInitiatedCheckoutPaymentMethodToken: 'nonce-that-represents-a-vaulted-paypal-account',\n * amount: '10.00',\n * currency: 'USD'\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * if (err.code === 'PAYPAL_POPUP_CLOSED') {\n * // indicates that customer canceled by\n * // manually closing the PayPal popup\n * }\n *\n * // handle other errors\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.startVaultInitiatedCheckout = function (options) {\n var missingRequiredParam;\n var self = this;\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.error.already-in-progress\");\n return Promise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS));\n }\n REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT.forEach(function (param) {\n if (!options.hasOwnProperty(param)) {\n missingRequiredParam = param;\n }\n });\n if (missingRequiredParam) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.type,\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.code,\n message: \"Required param \" + missingRequiredParam + \" is missing.\"\n }));\n }\n this._vaultInitiatedCheckoutInProgress = true;\n this._addModalBackdrop(options);\n options = assign({}, options, {\n flow: \"checkout\"\n });\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.started\");\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n var frameCommunicationPromise = new ExtendedPromise();\n var startVaultInitiatedCheckoutPromise = self._createPaymentResource(options, {\n returnUrl: self._constructVaultCheckutUrl(\"redirect-frame\"),\n cancelUrl: self._constructVaultCheckutUrl(\"cancel-frame\")\n }).then(function (response) {\n var redirectUrl = response.paymentResource.redirectUrl;\n self._frameService.redirect(redirectUrl);\n return frameCommunicationPromise;\n });\n self._frameService.open({}, self._createFrameServiceCallback(frameCommunicationPromise));\n return startVaultInitiatedCheckoutPromise;\n }).catch(function (err) {\n self._vaultInitiatedCheckoutInProgress = false;\n self._removeModalBackdrop();\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.canceled.by-customer\");\n return Promise.reject(new BraintreeError(errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED));\n }\n if (self._frameService) {\n self._frameService.close();\n }\n if (err.code && err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.failed.popup-not-opened\");\n return Promise.reject(new BraintreeError({\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.code,\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.type,\n message: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n return Promise.reject(err);\n }).then(function (response) {\n self._frameService.close();\n self._vaultInitiatedCheckoutInProgress = false;\n self._removeModalBackdrop();\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.succeeded\");\n return Promise.resolve(response);\n });\n };\n PayPalCheckout.prototype._addModalBackdrop = function (options) {\n if (options.optOutOfModalBackdrop) {\n return;\n }\n if (!this._modalBackdrop) {\n this._modalBackdrop = document.createElement(\"div\");\n this._modalBackdrop.setAttribute(\"data-braintree-paypal-vault-initiated-checkout-modal\", true);\n this._modalBackdrop.style.position = \"fixed\";\n this._modalBackdrop.style.top = 0;\n this._modalBackdrop.style.bottom = 0;\n this._modalBackdrop.style.left = 0;\n this._modalBackdrop.style.right = 0;\n this._modalBackdrop.style.zIndex = 9999;\n this._modalBackdrop.style.background = \"black\";\n this._modalBackdrop.style.opacity = \"0.7\";\n this._modalBackdrop.addEventListener(\"click\", function () {\n this.focusVaultInitiatedCheckoutWindow();\n }.bind(this));\n }\n document.body.appendChild(this._modalBackdrop);\n };\n PayPalCheckout.prototype._removeModalBackdrop = function () {\n if (!(this._modalBackdrop && this._modalBackdrop.parentNode)) {\n return;\n }\n this._modalBackdrop.parentNode.removeChild(this._modalBackdrop);\n };\n\n /**\n * Closes the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is closed.\n * @example\n * paypalCheckoutInstance.closeVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.closeVaultInitiatedCheckoutWindow = function () {\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.startVaultInitiatedCheckout.canceled.by-merchant\");\n }\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n this._frameService.close();\n }.bind(this));\n };\n\n /**\n * Focuses the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is focused.\n * @example\n * paypalCheckoutInstance.focusVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.focusVaultInitiatedCheckoutWindow = function () {\n return this._waitForVaultInitiatedCheckoutDependencies().then(function () {\n this._frameService.focus();\n }.bind(this));\n };\n PayPalCheckout.prototype._createFrameServiceCallback = function (frameCommunicationPromise) {\n var self = this;\n\n // TODO when a merchant integrates an iOS or Android integration\n // with a webview using the web SDK, we will have to add popupbridge\n // support\n return function (err, payload) {\n if (err) {\n frameCommunicationPromise.reject(err);\n } else if (payload) {\n self._frameService.redirect(self._loadingFrameUrl);\n self.tokenizePayment({\n paymentToken: payload.token,\n payerID: payload.PayerID,\n paymentID: payload.paymentId,\n orderID: payload.orderId\n }).then(function (res) {\n frameCommunicationPromise.resolve(res);\n }).catch(function (tokenizationError) {\n frameCommunicationPromise.reject(tokenizationError);\n });\n }\n };\n };\n PayPalCheckout.prototype._waitForVaultInitiatedCheckoutDependencies = function () {\n var self = this;\n return this._clientPromise.then(function () {\n return self._frameServicePromise;\n });\n };\n PayPalCheckout.prototype._constructVaultCheckutUrl = function (frameName) {\n var serviceId = this._frameService._serviceId;\n return this._assetsUrl + \"/html/\" + frameName + useMin(this._isDebug) + \".html?channel=\" + serviceId;\n };\n\n /**\n * Tokenizes the authorize data from the PayPal JS SDK when completing a buyer approval flow.\n * When a {@link callback} is defined, invokes the callback with {@link PayPalCheckout~tokenizePayload|tokenizePayload} and returns undefined. Otherwise, returns a Promise that resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @public\n * @param {object} tokenizeOptions Tokens and IDs required to tokenize the payment.\n * @param {string} tokenizeOptions.payerId Payer ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.paymentId] Payment ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.billingToken] Billing Token returned by PayPal `onApproved` callback.\n * @param {boolean} [tokenizeOptions.vault=true] Whether or not to vault the resulting PayPal account (if using a client token generated with a customer id and the vault flow).\n * @param {callback} [callback] The second argument, payload, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example Opt out of auto-vaulting behavior\n * // create the paypalCheckoutInstance with a client token generated with a customer id\n * paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n * onApproved: function (data) {\n * data.vault = false;\n *\n * return paypalCheckoutInstance.tokenizePayment(data);\n * },\n * // Add other options, e.g. onCancel, onError\n * }).render('#paypal-button');\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.tokenizePayment = function (tokenizeOptions) {\n var self = this;\n var shouldVault = true;\n var payload;\n var options = {\n flow: tokenizeOptions.billingToken && !tokenizeOptions.paymentID ? \"vault\" : \"checkout\",\n intent: tokenizeOptions.intent || this.intentFromCreatePayment\n };\n var params = {\n // The paymentToken provided by the PayPal JS SDK is the EC Token\n ecToken: tokenizeOptions.paymentToken,\n billingToken: tokenizeOptions.billingToken,\n payerId: tokenizeOptions.payerID,\n paymentId: tokenizeOptions.paymentID,\n orderId: tokenizeOptions.orderID,\n shippingOptionsId: tokenizeOptions.shippingOptionsId\n };\n if (tokenizeOptions.hasOwnProperty(\"vault\")) {\n shouldVault = tokenizeOptions.vault;\n }\n options.vault = shouldVault;\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.tokenization.started\");\n return this._clientPromise.then(function (client) {\n return client.request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: self._formatTokenizeData(options, params)\n });\n }).then(function (response) {\n payload = self._formatTokenizePayload(response);\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.tokenization.success\");\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.credit.accepted\");\n }\n return payload;\n }).catch(function (err) {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.tokenization.failed\");\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message\n }));\n });\n };\n\n /**\n * Resolves with the PayPal client id to be used when loading the PayPal SDK.\n * @public\n * @param {callback} [callback] The second argument, id, is a the PayPal client id. If no callback is provided, the promise resolves with the PayPal client id.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * paypalCheckoutInstance.getClientId().then(function (id) {\n * var script = document.createElement('script');\n *\n * script.src = 'https://www.paypal.com/sdk/js?client-id=' + id;\n * script.onload = function () {\n * // setup the PayPal SDK\n * };\n *\n * document.body.appendChild(script);\n * });\n */\n PayPalCheckout.prototype.getClientId = function () {\n return this._clientPromise.then(function (client) {\n return client.getConfiguration().gatewayConfiguration.paypal.clientId;\n });\n };\n\n /**\n * Resolves when the PayPal SDK has been successfully loaded onto the page.\n * @public\n * @param {object} [options] A configuration object to modify the query params and data-attributes on the PayPal SDK. A subset of the parameters are listed below. For a full list of query params, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/?mark=query#query-parameters).\n * @param {string} [options.client-id] By default, this will be the client id associated with the authorization used to create the Braintree component. When used in conjunction with passing `authorization` when creating the PayPal Checkout component, you can speed up the loading of the PayPal SDK.\n * @param {string} [options.intent=\"authorize\"] By default, the PayPal SDK defaults to an intent of `capture`. Since the default intent when calling {@link PayPalCheckout#createPayment|`createPayment`} is `authorize`, the PayPal SDK will be loaded with `intent=authorize`. If you wish to use a different intent when calling {@link PayPalCheckout#createPayment|`createPayment`}, make sure it matches here. If `sale` is used, it will be converted to `capture` for the PayPal SDK. If the `vault: true` param is used, `tokenize` will be passed as the default intent.\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {string} [options.currency=\"USD\"] If a currency is passed in {@link PayPalCheckout#createPayment|`createPayment`}, it must match the currency passed here.\n * @param {boolean} [options.vault] Must be `true` when using `flow: vault` in {@link PayPalCheckout#createPayment|`createPayment`}.\n * @param {string} [options.components=buttons] By default, the Braintree SDK will only load the PayPal smart buttons component. If you would like to load just the [messages component](https://developer.paypal.com/docs/business/checkout/add-capabilities/credit-messaging/), pass `messages`. If you would like to load both, pass `buttons,messages`\n * @param {object} [options.dataAttributes] The data attributes to apply to the script. Any data attribute can be passed. A subset of the parameters are listed below. For a full list of data attributes, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#script-parameters).\n * @param {string} [options.dataAttributes.client-token] The client token to use in the script. (usually not needed)\n * @param {string} [options.dataAttributes.csp-nonce] See the [PayPal docs about content security nonces](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#csp-nonce).\n * @param {callback} [callback] Called when the PayPal SDK has been loaded onto the page. The second argument is the PayPal Checkout instance. If no callback is provided, the promise resolves with the PayPal Checkout instance when the PayPal SDK has been loaded onto the page.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example Without options\n * paypalCheckoutInstance.loadPayPalSDK().then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example With options\n * paypalCheckoutInstance.loadPayPalSDK({\n * 'client-id': 'PayPal Client Id', // Can speed up rendering time to hardcode this value\n *\n * intent: 'capture', // Make sure this value matches the value in createPayment\n * currency: 'USD', // Make sure this value matches the value in createPayment\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example With Vaulting\n * paypalCheckoutInstance.loadPayPalSDK({\n * vault: true\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n */\n PayPalCheckout.prototype.loadPayPalSDK = function (options) {\n var idPromise, src;\n var loadPromise = new ExtendedPromise();\n var dataAttributes = options && options.dataAttributes || {};\n var userIdToken = dataAttributes[\"user-id-token\"] || dataAttributes[\"data-user-id-token\"];\n if (!userIdToken) {\n userIdToken = this._authorizationInformation.fingerprint && this._authorizationInformation.fingerprint.split(\"?\")[0];\n }\n this._paypalScript = document.createElement(\"script\");\n\n // NEXT_MAJOR_VERSION\n // this options object should have 2 properties:\n // * queryParams\n // * dataAttributes\n // should make organizing this better than squashing\n // all the query params at the top level and extracting\n // the data attributes\n options = assign({}, {\n components: \"buttons\"\n }, options);\n delete options.dataAttributes;\n\n // NEXT_MAJOR_VERSION if merchant passes an explicit intent,\n // currency, amount, etc, save those for use in createPayment\n // if no explicit param of that type is passed in when calling\n // createPayment to reduce the number of items that need to be\n // duplicated here and in createPayment\n if (options.vault) {\n options.intent = options.intent || \"tokenize\";\n } else {\n options.intent = options.intent || \"authorize\";\n options.currency = options.currency || \"USD\";\n }\n src = \"https://www.paypal.com/sdk/js?\";\n this._paypalScript.onload = function () {\n loadPromise.resolve();\n };\n Object.keys(dataAttributes).forEach(function (attribute) {\n this._paypalScript.setAttribute(\"data-\" + attribute.replace(/^data\\-/, \"\"), dataAttributes[attribute]);\n }.bind(this));\n if (options[\"client-id\"]) {\n idPromise = Promise.resolve(options[\"client-id\"]);\n } else {\n idPromise = this.getClientId();\n }\n idPromise.then(function (id) {\n options[\"client-id\"] = id;\n if (this._autoSetDataUserIdToken && userIdToken) {\n this._paypalScript.setAttribute(\"data-user-id-token\", userIdToken);\n\n // preloading improves the rendering time of the PayPal button\n this._attachPreloadPixel({\n id: id,\n userIdToken: userIdToken,\n amount: dataAttributes.amount,\n currency: options.currency,\n merchantId: options[\"merchant-id\"]\n });\n }\n this._paypalScript.src = querystring.queryify(src, options);\n document.head.insertBefore(this._paypalScript, document.head.firstElementChild);\n }.bind(this));\n return loadPromise.then(function () {\n return this;\n }.bind(this));\n };\n PayPalCheckout.prototype._attachPreloadPixel = function (options) {\n var request;\n var id = options.id;\n var userIdToken = options.userIdToken;\n var env = this._authorizationInformation.environment;\n var subdomain = env === \"production\" ? \"\" : \"sandbox.\";\n var url = PAYPAL_SDK_PRELOAD_URL.replace(\"{ENV}\", subdomain);\n var preloadOptions = {\n \"client-id\": id,\n \"user-id-token\": userIdToken\n };\n if (options.amount) {\n preloadOptions.amount = options.amount;\n }\n if (options.currency) {\n preloadOptions.currency = options.currency;\n }\n if (options.merchantId) {\n preloadOptions[\"merchant-id\"] = options.merchantId;\n }\n request = new XMLHttpRequest();\n request.open(\"GET\", querystring.queryify(url, preloadOptions));\n request.send();\n };\n PayPalCheckout.prototype._formatPaymentResourceData = function (options, config) {\n var key;\n var gatewayConfiguration = this._configuration.gatewayConfiguration;\n // NEXT_MAJOR_VERSION default value for intent in PayPal SDK is capture\n // but our integrations default value is authorize. Default this to capture\n // in the next major version.\n var intent = options.intent;\n var paymentResource = {\n // returnUrl and cancelUrl are required in hermes create_payment_resource route\n // but are not used by the PayPal sdk, except to redirect to an error page\n returnUrl: config.returnUrl || \"https://www.paypal.com/checkoutnow/error\",\n cancelUrl: config.cancelUrl || \"https://www.paypal.com/checkoutnow/error\",\n offerPaypalCredit: options.offerCredit === true,\n merchantAccountId: this._merchantAccountId,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType\n },\n shippingOptions: options.shippingOptions\n };\n if (options.flow === \"checkout\") {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n paymentResource.requestBillingAgreement = options.requestBillingAgreement;\n if (intent) {\n // 'sale' has been changed to 'capture' in PayPal's backend, but\n // we use an old version with 'sale'. We provide capture as an alias\n // to match the PayPal SDK\n if (intent === \"capture\") {\n intent = \"sale\";\n }\n paymentResource.intent = intent;\n }\n if (options.hasOwnProperty(\"lineItems\")) {\n paymentResource.lineItems = options.lineItems;\n }\n if (options.hasOwnProperty(\"vaultInitiatedCheckoutPaymentMethodToken\")) {\n paymentResource.vaultInitiatedCheckoutPaymentMethodToken = options.vaultInitiatedCheckoutPaymentMethodToken;\n }\n if (options.hasOwnProperty(\"shippingOptions\")) {\n paymentResource.shippingOptions = options.shippingOptions;\n }\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n if (options.hasOwnProperty(\"billingAgreementDetails\")) {\n paymentResource.billingAgreementDetails = options.billingAgreementDetails;\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n\n // this needs to be set outside of the block where add it to the\n // payment request so that a follow up tokenization call can use it,\n // but if a second create payment resource call is made without\n // the correlation id, we want to reset it to undefined so that the\n // tokenization call does not use a stale correlation id\n this._riskCorrelationId = options.riskCorrelationId;\n if (options.riskCorrelationId) {\n paymentResource.correlationId = this._riskCorrelationId;\n }\n return paymentResource;\n };\n\n /**\n * @ignore\n * @static\n * @function _verifyConsistentCurrency\n * Verifies that `options.currency` and the currencies for each `shippingOption` the same.\n * @param {object} options `options` provided for `updatePayment`.\n * @returns {boolean} true is currencies match (or no shipping options); false if currencies do not match.\n */\n\n PayPalCheckout.prototype._verifyConsistentCurrency = function (options) {\n if (options.currency && options.hasOwnProperty(\"shippingOptions\") && Array.isArray(options.shippingOptions)) {\n return options.shippingOptions.every(function (item) {\n return item.amount && item.amount.currency && options.currency.toLowerCase() === item.amount.currency.toLowerCase();\n });\n }\n return true;\n };\n\n /**\n * @ignore\n * @static\n * @function _hasMissingOption\n * @param {object} options All options provided for intiating the PayPal flow.\n * @param {array} required A list of required inputs that must be include as part of the options.\n * @returns {boolean} Returns a boolean.\n */\n\n PayPalCheckout.prototype._hasMissingOption = function (options, required) {\n var i, option;\n required = required || [];\n if (!options.hasOwnProperty(\"amount\") && !options.hasOwnProperty(\"lineItems\")) {\n return true;\n }\n for (i = 0; i < required.length; i++) {\n option = required[i];\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n return false;\n };\n PayPalCheckout.prototype._formatUpdatePaymentData = function (options) {\n var self = this;\n var paymentResource = {\n merchantAccountId: this._merchantAccountId,\n paymentId: options.paymentId || options.orderId,\n currencyIsoCode: options.currency\n };\n if (options.hasOwnProperty(\"amount\")) {\n paymentResource.amount = options.amount;\n }\n if (options.hasOwnProperty(\"lineItems\")) {\n paymentResource.lineItems = options.lineItems;\n }\n if (options.hasOwnProperty(\"shippingOptions\")) {\n paymentResource.shippingOptions = options.shippingOptions;\n }\n\n /* shippingAddress not supported yet */\n if (options.hasOwnProperty(\"shippingAddress\")) {\n analytics.sendEvent(self._clientPromise, \"paypal-checkout.updatePayment.shippingAddress.provided.by-the-merchant\");\n paymentResource.line1 = options.shippingAddress.line1;\n if (options.shippingAddress.hasOwnProperty(\"line2\")) {\n paymentResource.line2 = options.shippingAddress.line2;\n }\n paymentResource.city = options.shippingAddress.city;\n paymentResource.state = options.shippingAddress.state;\n paymentResource.postalCode = options.shippingAddress.postalCode;\n paymentResource.countryCode = options.shippingAddress.countryCode;\n if (options.shippingAddress.hasOwnProperty(\"phone\")) {\n paymentResource.phone = options.shippingAddress.phone;\n }\n if (options.shippingAddress.hasOwnProperty(\"recipientName\")) {\n paymentResource.recipientName = options.shippingAddress.recipientName;\n }\n }\n return paymentResource;\n };\n PayPalCheckout.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._configuration;\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey = clientConfiguration.authorizationType === \"TOKENIZATION_KEY\";\n var isVaultFlow = options.flow === \"vault\";\n var correlationId = this._riskCorrelationId || params.billingToken || params.ecToken;\n var data = {\n paypalAccount: {\n correlationId: correlationId,\n options: {\n validate: isVaultFlow && !isTokenizationKey && options.vault\n }\n }\n };\n if (isVaultFlow) {\n data.paypalAccount.billingAgreementToken = params.billingToken;\n } else {\n data.paypalAccount.paymentToken = params.paymentId || params.orderId;\n data.paypalAccount.payerId = params.payerId;\n data.paypalAccount.unilateral = gatewayConfiguration.paypal.unvettedMerchant;\n if (options.intent) {\n data.paypalAccount.intent = options.intent;\n }\n }\n if (this._merchantAccountId) {\n data.merchantAccountId = this._merchantAccountId;\n }\n return data;\n };\n PayPalCheckout.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n if (account.details && account.details.shippingOptionId) {\n payload.shippingOptionId = account.details.shippingOptionId;\n }\n if (account.details && account.details.cobrandedCardLabel) {\n payload.cobrandedCardLabel = account.details.cobrandedCardLabel;\n }\n return payload;\n };\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/paypal-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * paypalCheckoutInstance.teardown();\n * @example With callback\n * paypalCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPalCheckout.prototype.teardown = function () {\n var self = this;\n convertMethodsToError(this, methods(PayPalCheckout.prototype));\n if (this._paypalScript && this._paypalScript.parentNode) {\n this._paypalScript.parentNode.removeChild(this._paypalScript);\n }\n return this._frameServicePromise.catch(function () {\n // no need to error in teardown for an error setting up the frame service\n }).then(function () {\n if (!self._frameService) {\n return Promise.resolve();\n }\n return self._frameService.teardown();\n });\n };\n module.exports = wrapPromise.wrapPrototype(PayPalCheckout);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/assign\": 121,\n \"../lib/braintree-error\": 124,\n \"../lib/constants\": 126,\n \"../lib/convert-methods-to-error\": 127,\n \"../lib/convert-to-braintree-error\": 128,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-authorization-data\": 130,\n \"../lib/create-deferred-client\": 131,\n \"../lib/frame-service/external\": 139,\n \"../lib/methods\": 155,\n \"../lib/querystring\": 157,\n \"../lib/use-min\": 160,\n \"../paypal/shared/constants\": 180,\n \"./errors\": 175,\n \"@braintree/extended-promise\": 34,\n \"@braintree/wrap-promise\": 43\n }],\n 178: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var frameService = _dereq_(\"../../lib/frame-service/external\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var once = _dereq_(\"../../lib/once\");\n var VERSION = \"3.101.1\";\n var constants = _dereq_(\"../shared/constants\");\n var INTEGRATION_TIMEOUT_MS = _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\n var analytics = _dereq_(\"../../lib/analytics\");\n var methods = _dereq_(\"../../lib/methods\");\n var deferred = _dereq_(\"../../lib/deferred\");\n var errors = _dereq_(\"../shared/errors\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var querystring = _dereq_(\"../../lib/querystring\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @typedef {object} PayPal~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact support](https://developer.paypal.com/braintree/help) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @property {object} creditFinancingOffered.totalCost This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n *\n */\n\n /**\n * @typedef {object} PayPal~tokenizeReturn\n * @property {Function} close A handle to close the PayPal checkout flow.\n * @property {Function} focus A handle to focus the PayPal checkout flow. Note that some browsers (notably iOS Safari) do not support focusing popups. Firefox requires the focus call to occur as the result of a user interaction, such as a button click.\n */\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal.create|paypal.create}\n * @classdesc This class represents a PayPal component. Instances of this class can open a PayPal window for authenticating a PayPal account. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * This component has been deprecated in favor of the {@link PayPalCheckout|PayPal Checkout component}, which provides a fully managed UI. New features will not be added to this component.\n * @description Do not use this constructor directly. Use {@link module:braintree-web/paypal.create|braintree-web.paypal.create} instead.\n */\n function PayPal(options) {\n this._client = options.client;\n this._assetsUrl = options.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl = this._assetsUrl + \"/html/paypal-landing-frame\" + useMin(this._isDebug) + \".html\";\n this._authorizationInProgress = false;\n }\n PayPal.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, \"paypal.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n return new Promise(function (resolve) {\n frameService.create({\n name: constants.LANDING_FRAME_NAME,\n dispatchFrameUrl: self._assetsUrl + \"/html/dispatch-frame\" + useMin(self._isDebug) + \".html\",\n openFrameUrl: self._loadingFrameUrl\n }, function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, \"paypal.load.succeeded\");\n resolve(self);\n });\n });\n };\n\n /**\n * Launches the PayPal login flow and returns a nonce payload. Only one PayPal login flow should be active at a time. One way to achieve this is to disable your PayPal button while the flow is open.\n * @public\n * @param {object} options All tokenization options for the PayPal component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer id, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `sale` - Payment will be immediately submitted for settlement upon creating a transaction.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {boolean} [options.offerPayLater=false] Offers PayPal Pay Later if the customer qualifies. Defaults to false. Only available with `flow: 'checkout'`.\n * @param {string} [options.useraction]\n * Changes the call-to-action in the PayPal flow. By default the final button will show the localized\n * word for \"Continue\" and implies that the final amount billed is not yet known.\n *\n * Setting this option to `commit` changes the button text to \"Pay Now\" and page text will convey to\n * the user that billing will take place immediately.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow.\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {callback} callback The second argument, data, is a {@link PayPal~tokenizePayload|tokenizePayload}.\n * @example\n * Tokenizing with the vault flow\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // if there is any other part of the page that must be disabled\n * // while authentication is in progress, do so now\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'vault' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * // if any other part of the page was disabled, re-enable now\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n \n * @example\n * Tokenizing with the checkout flow\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'checkout', // Required\n * amount: '10.00', // Required\n * currency: 'USD' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n * @returns {Promise|PayPal~tokenizeReturn} A handle to manage the PayPal checkout frame. If no callback is provided, returns a promise.\n */\n PayPal.prototype.tokenize = function (options, callback) {\n var self = this;\n var client = this._client;\n var tokenizePromise, optionError;\n if (callback) {\n callback = once(deferred(callback));\n }\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n optionError = new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED);\n if (callback) {\n callback(optionError);\n return this._frameService.createNoopHandler();\n }\n return Promise.reject(optionError);\n }\n tokenizePromise = new Promise(function (resolve, reject) {\n if (self._authorizationInProgress) {\n analytics.sendEvent(client, \"paypal.tokenization.error.already-opened\");\n reject(new BraintreeError(errors.PAYPAL_TOKENIZATION_REQUEST_ACTIVE));\n } else {\n self._authorizationInProgress = true;\n if (!window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.opened\");\n }\n if (options.offerCredit === true) {\n analytics.sendEvent(client, \"paypal.credit.offered\");\n }\n if (options.offerPayLater === true) {\n analytics.sendEvent(client, \"paypal.paylater.offered\");\n }\n self._navigateFrameToAuth(options).catch(reject);\n // self MUST happen after _navigateFrameToAuth for Metro browsers to work.\n self._frameService.open({}, self._createFrameServiceCallback(options, resolve, reject));\n }\n });\n if (callback) {\n tokenizePromise.then(function (res) {\n callback(null, res);\n }).catch(callback);\n return this._frameService.createHandler({\n beforeClose: function () {\n analytics.sendEvent(client, \"paypal.tokenization.closed.by-merchant\");\n }\n });\n }\n return tokenizePromise;\n };\n PayPal.prototype._createFrameServiceCallback = function (options, resolve, reject) {\n var self = this;\n var client = this._client;\n if (window.popupBridge) {\n return function (err, payload) {\n var canceled = payload && payload.path && payload.path.substring(0, 7) === \"/cancel\";\n self._authorizationInProgress = false;\n\n // `err` exists when the user clicks \"Done\" button of browser view\n if (err || canceled) {\n analytics.sendEvent(client, \"paypal.tokenization.closed-popupbridge.by-user\");\n // Call merchant's tokenize callback with an error\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (payload) {\n self._tokenizePayPal(options, payload.queryItems).then(resolve).catch(reject);\n }\n };\n }\n return function (err, params) {\n self._authorizationInProgress = false;\n if (err) {\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(client, \"paypal.tokenization.closed.by-user\");\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (err.code && err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1) {\n reject(new BraintreeError({\n code: errors.PAYPAL_POPUP_OPEN_FAILED.code,\n type: errors.PAYPAL_POPUP_OPEN_FAILED.type,\n message: errors.PAYPAL_POPUP_OPEN_FAILED.message,\n details: {\n originalError: err\n }\n }));\n }\n } else if (params) {\n self._tokenizePayPal(options, params).then(resolve).catch(reject);\n }\n };\n };\n PayPal.prototype._tokenizePayPal = function (options, params) {\n var self = this;\n var client = this._client;\n if (!window.popupBridge) {\n this._frameService.redirect(this._loadingFrameUrl);\n }\n return client.request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: this._formatTokenizeData(options, params)\n }).then(function (response) {\n var payload = self._formatTokenizePayload(response);\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.success-popupbridge\");\n } else {\n analytics.sendEvent(client, \"paypal.tokenization.success\");\n }\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(client, \"paypal.credit.accepted\");\n }\n self._frameService.close();\n return payload;\n }).catch(function (err) {\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.failed-popupbridge\");\n } else {\n analytics.sendEvent(client, \"paypal.tokenization.failed\");\n }\n self._frameService.close();\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message\n }));\n });\n };\n PayPal.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type\n };\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n return payload;\n };\n PayPal.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._client.getConfiguration();\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey = clientConfiguration.authorizationType === \"TOKENIZATION_KEY\";\n var data = {\n paypalAccount: {\n correlationId: params.ba_token || params.token,\n options: {\n validate: options.flow === \"vault\" && !isTokenizationKey\n }\n }\n };\n if (params.ba_token) {\n data.paypalAccount.billingAgreementToken = params.ba_token;\n } else {\n data.paypalAccount.paymentToken = params.paymentId;\n data.paypalAccount.payerId = params.PayerID;\n data.paypalAccount.unilateral = gatewayConfiguration.paypal.unvettedMerchant;\n if (options.hasOwnProperty(\"intent\")) {\n data.paypalAccount.intent = options.intent;\n }\n }\n return data;\n };\n PayPal.prototype._navigateFrameToAuth = function (options) {\n var self = this;\n var client = this._client;\n var endpoint = \"paypal_hermes/\" + constants.FLOW_ENDPOINTS[options.flow];\n return client.request({\n endpoint: endpoint,\n method: \"post\",\n data: this._formatPaymentResourceData(options)\n }).then(function (response) {\n var redirectUrl;\n if (options.flow === \"checkout\") {\n redirectUrl = response.paymentResource.redirectUrl;\n } else {\n redirectUrl = response.agreementSetup.approvalUrl;\n }\n if (options.useraction === \"commit\") {\n redirectUrl = querystring.queryify(redirectUrl, {\n useraction: \"commit\"\n });\n }\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.opened-popupbridge\");\n }\n self._frameService.redirect(redirectUrl);\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n self._frameService.close();\n self._authorizationInProgress = false;\n if (status === 422) {\n return Promise.reject(new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err\n }\n }));\n }\n return Promise.reject(convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message\n }));\n });\n };\n PayPal.prototype._formatPaymentResourceData = function (options) {\n var key;\n var gatewayConfiguration = this._client.getConfiguration().gatewayConfiguration;\n var serviceId = this._frameService._serviceId;\n var paymentResource = {\n returnUrl: gatewayConfiguration.paypal.assetsUrl + \"/web/\" + VERSION + \"/html/redirect-frame\" + useMin(this._isDebug) + \".html?channel=\" + serviceId,\n cancelUrl: gatewayConfiguration.paypal.assetsUrl + \"/web/\" + VERSION + \"/html/cancel-frame\" + useMin(this._isDebug) + \".html?channel=\" + serviceId,\n offerPaypalCredit: options.offerCredit === true,\n offerPayLater: options.offerPayLater === true,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType\n }\n };\n if (window.popupBridge && typeof window.popupBridge.getReturnUrlPrefix === \"function\") {\n paymentResource.returnUrl = window.popupBridge.getReturnUrlPrefix() + \"return\";\n paymentResource.cancelUrl = window.popupBridge.getReturnUrlPrefix() + \"cancel\";\n }\n if (options.flow === \"checkout\") {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n if (options.hasOwnProperty(\"intent\")) {\n paymentResource.intent = options.intent;\n }\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n return paymentResource;\n };\n\n /**\n * Closes the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.closeWindow();\n * @returns {void}\n */\n PayPal.prototype.closeWindow = function () {\n if (this._authorizationInProgress) {\n analytics.sendEvent(this._client, \"paypal.tokenize.closed.by-merchant\");\n }\n this._frameService.close();\n };\n\n /**\n * Focuses the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.focusWindow();\n * @returns {void}\n */\n PayPal.prototype.focusWindow = function () {\n this._frameService.focus();\n };\n\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/paypal.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paypalInstance.teardown();\n * @example With callback\n * paypalInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n PayPal.prototype.teardown = wrapPromise(function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n convertMethodsToError(self, methods(PayPal.prototype));\n analytics.sendEvent(self._client, \"paypal.teardown-completed\");\n return Promise.resolve();\n });\n module.exports = PayPal;\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/braintree-error\": 124,\n \"../../lib/constants\": 126,\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/convert-to-braintree-error\": 128,\n \"../../lib/deferred\": 132,\n \"../../lib/frame-service/external\": 139,\n \"../../lib/methods\": 155,\n \"../../lib/once\": 156,\n \"../../lib/querystring\": 157,\n \"../../lib/use-min\": 160,\n \"../shared/constants\": 180,\n \"../shared/errors\": 181,\n \"@braintree/wrap-promise\": 43\n }],\n 179: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/paypal\n * @description A component to integrate with PayPal.\n * @deprecated Use the {@link PayPalCheckout|PayPal Checkout component} instead.\n */\n var analytics = _dereq_(\"../lib/analytics\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var errors = _dereq_(\"./shared/errors\");\n var PayPal = _dereq_(\"./external/paypal\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link PayPal} instance.\n * @example\n * // We recommend creating your PayPal button with button.js\n * // For an example, see https://codepen.io/braintree/pen/LNKJWa\n * var paypalButton = document.querySelector('.paypal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.paypal.create({\n * client: clientInstance\n * }, function (paypalErr, paypalInstance) {\n * if (paypalErr) {\n * console.error('Error creating PayPal:', paypalErr);\n * return;\n * }\n *\n * paypalButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to tokenize.\n * paypalButton.addEventListener('click', function (event) {\n * // Because tokenization opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * paypalInstance.tokenize({\n * flow: 'vault'\n * // For more tokenization options, see the full PayPal tokenization documentation\n * // https://braintree.github.io/braintree-web/current/PayPal.html#tokenize\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * if (tokenizeErr.type !== 'CUSTOMER') {\n * console.error('Error tokenizing:', tokenizeErr);\n * }\n * return;\n * }\n *\n * // Tokenization succeeded\n * paypalButton.setAttribute('disabled', true);\n * console.log('Got a nonce! You should submit this to your server.');\n * console.log(payload.nonce);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"PayPal\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var pp;\n var config = client.getConfiguration();\n options.client = client;\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(new BraintreeError(errors.PAYPAL_NOT_ENABLED));\n }\n analytics.sendEvent(options.client, \"paypal.initialized\");\n pp = new PayPal(options);\n return pp._initialize();\n });\n }\n\n /**\n * @static\n * @function isSupported\n * @description Returns true if PayPal [supports this browser](index.html#browser-support-webviews).\n * @example\n * if (braintree.paypal.isSupported()) {\n * // Add PayPal button to the page\n * } else {\n * // Hide PayPal payment option\n * }\n * @returns {Boolean} Returns true if PayPal supports this browser.\n */\n function isSupported() {\n return true;\n }\n module.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./external/paypal\": 178,\n \"./shared/errors\": 181,\n \"@braintree/wrap-promise\": 43\n }],\n 180: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n LANDING_FRAME_NAME: \"braintreepaypallanding\",\n FLOW_ENDPOINTS: {\n checkout: \"create_payment_resource\",\n vault: \"setup_billing_agreement\"\n },\n REQUIRED_OPTIONS: [\"paymentId\", \"currency\"]\n };\n }, {}],\n 181: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.PayPal - Creation Error Codes\n * @description Errors that occur when [creating the PayPal component](./module-braintree-web_paypal.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.PayPal - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PayPal.html#tokenize).\n * @property {MERCHANT} PAYPAL_TOKENIZATION_REQUEST_ACTIVE Occurs when a tokenization request is already in progress.\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when flow option is not provided.\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when PayPal flow could not be initiated.\n * @property {MERCHANT} PAYPAL_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened.\n * @property {CUSTOMER} PAYPAL_POPUP_CLOSED Occurs when customer closes the PayPal window before completing the flow.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is passed.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_NOT_ENABLED\",\n message: \"PayPal is not enabled for this merchant.\"\n },\n PAYPAL_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_TOKENIZATION_REQUEST_ACTIVE\",\n message: \"Another tokenization request is active.\"\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's PayPal account.\"\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_FLOW_FAILED\",\n message: \"Could not initialize PayPal flow.\"\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_FLOW_OPTION_REQUIRED\",\n message: \"PayPal flow property is invalid or missing.\"\n },\n PAYPAL_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_POPUP_OPEN_FAILED\",\n message: \"PayPal popup failed to open, make sure to tokenize in response to a user action.\"\n },\n PAYPAL_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYPAL_POPUP_CLOSED\",\n message: \"Customer closed PayPal popup before authorizing.\"\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_INVALID_PAYMENT_OPTION\",\n message: \"PayPal payment options are invalid.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 182: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /** @module braintree-web/preferred-payment-methods */\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var PreferredPaymentMethods = _dereq_(\"./preferred-payment-methods\");\n var VERSION = \"3.101.1\";\n\n // NEXT_MAJOR_VERSION\n // Remove this integration entirely. It doesn't work, isn't documented, and otherwise isn't going to be pursued further beyond the non-operational beta it is in.\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link PreferredPaymentMethods} instance.\n * @example\n * braintree.preferredPaymentMethods.create({\n * client: clientInstance\n * }).then(function (preferredPaymentMethodsInstance) {\n * // preferredPaymentMethodsInstance is ready to be used.\n * }).catch(function (error) {\n * // handle creation error\n * });\n * @returns {Promise|void} Returns a Promise with resolves with the PreferredPaymentMethods instance.\n */\n function create(options) {\n var name = \"PreferredPaymentMethods\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var instance = new PreferredPaymentMethods();\n return instance.initialize(options);\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"./preferred-payment-methods\": 183,\n \"@braintree/wrap-promise\": 43\n }],\n 183: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var analytics = _dereq_(\"../lib/analytics\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/preferred-payment-methods.create|preferred-payment-methods.create}\n */\n function PreferredPaymentMethods() {}\n PreferredPaymentMethods.prototype.initialize = function (options) {\n var self = this;\n this._clientPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: \"PreferredPaymentMethods\"\n }).catch(function (err) {\n self._setupError = err;\n return Promise.reject(err);\n });\n analytics.sendEvent(this._clientPromise, \"preferred-payment-methods.initialized\");\n return Promise.resolve(this);\n };\n\n /**\n * Fetches information about which payment methods are preferred on the device.\n * Used to determine which payment methods are given preference in your UI,\n * not whether they are presented entirely.\n *\n * This class is currently in beta and may change in future releases.\n * @public\n * @returns {Promise|void} Returns a promise if no callback is provided.\n * @example\n * Preferred Payment Methods\n * preferredPaymentMethodsInstance.fetchPreferredPaymentMethods().then(function (result) {\n * if (result.paypalPreferred) {\n * // PayPal preferred\n * } else {\n * // PayPal not preferred\n * }\n *\n * if (result.venmoPreferred) {\n * // Venmo preferred\n * } else {\n * // Venmo not preferred\n * }\n * });\n */\n PreferredPaymentMethods.prototype.fetchPreferredPaymentMethods = function () {\n var client;\n var self = this;\n return this._clientPromise.then(function (clientInstance) {\n client = clientInstance;\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: \"query PreferredPaymentMethods { \" + \"preferredPaymentMethods { \" + \"paypalPreferred \" + \"venmoPreferred \" + \"} \" + \"}\"\n }\n });\n }).then(function (result) {\n var paypalPreferred = result.data.preferredPaymentMethods.paypalPreferred;\n var venmoPreferred = result.data.preferredPaymentMethods.venmoPreferred;\n analytics.sendEvent(client, \"preferred-payment-methods.paypal.api-detected.\" + paypalPreferred);\n analytics.sendEvent(client, \"preferred-payment-methods.venmo.api-detected.\" + venmoPreferred);\n return {\n paypalPreferred: paypalPreferred,\n venmoPreferred: venmoPreferred\n };\n }).catch(function () {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n analytics.sendEvent(client, \"preferred-payment-methods.api-error\");\n return {\n paypalPreferred: false,\n venmoPreferred: false\n };\n });\n };\n module.exports = wrapPromise.wrapPrototype(PreferredPaymentMethods);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"@braintree/wrap-promise\": 43\n }],\n 184: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var sepaErrors = _dereq_(\"../shared/errors\");\n var frameService = _dereq_(\"../../lib/frame-service/external\");\n var analytics = _dereq_(\"../../lib/analytics\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var billingAddressOptions = _dereq_(\"../shared/constants\").BILLING_ADDRESS_OPTIONS;\n var snakeCaseToCamelCase = _dereq_(\"../../lib/snake-case-to-camel-case\");\n var POPUP_WIDTH = 400;\n var POPUP_HEIGHT = 570;\n\n /**\n * @ignore\n * @typedef CreateMandateResponse\n * @property {string} approvalUrl The URL to present to the customer for payment approval.\n * @property {string} last4 The last four digits of the iban.\n * @property {string} bankReferenceToken The tokenized payment source to fun the payment.\n */\n\n /**\n *\n * A function that creates a mandate so that we can present the mandate to the customer via a popup.\n *\n * @ignore\n * @static\n * @function createMandate\n * @param {object} client The Braintree client.\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.accountHolderName] The account holder name.\n * @param {object} [options.billingAddress] The customer's billing address\n * @param {string} [options.billingAddress.addressLine1] Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @param {string} [options.billingAddress.addressLine2] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @param {string} [options.billingAddress.adminArea1] Customer's city.\n * @param {string} [options.billingAddress.adminArea2] Customer's region or state.\n * @param {string} [options.billingAddress.postalCode] Customer's postal code.\n * @param {string} [options.cancelUrl] The URL to redirect to if authorization is cancelled.\n * @param {string} [options.countryCode] The customer's country code. Also used as billing address country code.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.iban] The customer's International Bank Account Number.\n * @param {string} [options.locale] The BCP 47-formatted locale. See https://developer.paypal.com/reference/locale-codes/ for a list of possible values.\n * @param {string} [options.mandateType] Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {string} [options.merchantId] The merchant id.\n * @param {string} [options.returnUrl] The URL to redirect to if authorization is successful.\n * @returns {Promise} Returns a promise with the mandate response or an error.\n */\n\n function createMandate(client, options) {\n // Disabling eslint because api is expecting snake_case format for the keys\n /* eslint-disable */\n var data = {\n sepa_debit: {\n account_holder_name: options.accountHolderName,\n billing_address: {\n country_code: options.countryCode\n },\n iban: options.iban,\n merchant_or_partner_customer_id: options.customerId,\n mandate_type: options.mandateType\n },\n locale: options.locale,\n cancel_url: options.cancelUrl,\n return_url: options.returnUrl,\n merchant_account_id: options.merchantAccountId\n };\n if (options.billingAddress) {\n billingAddressOptions.forEach(function (option) {\n var ccOption = snakeCaseToCamelCase(option);\n if (ccOption in options.billingAddress) {\n data.sepa_debit.billing_address[option] = options.billingAddress[ccOption]; // camelCase equivilent of option (eg. postal_code = postalCode) ]\n }\n });\n }\n /* eslint-enable */\n\n return client.request({\n api: \"clientApi\",\n method: \"post\",\n endpoint: \"sepa_debit\",\n data: data\n }).then(function (response) {\n var sepaDebitAccount = response.message.body.sepaDebitAccount;\n if (!sepaDebitAccount) {\n throw new BraintreeError(sepaErrors.SEPA_CREATE_MANDATE_FAILED);\n }\n return {\n approvalUrl: sepaDebitAccount.approvalUrl,\n last4: sepaDebitAccount.last4,\n bankReferenceToken: sepaDebitAccount.bankReferenceToken\n };\n }).catch(function () {\n throw new BraintreeError(sepaErrors.SEPA_CREATE_MANDATE_FAILED);\n });\n }\n\n /**\n *\n * A function for opening and managing the popup used for authorization.\n *\n * @ignore\n * @param {string} client The Braintree client.\n * @param {string} options The input options needed to manage the popup portion of the flow.\n * @param {string} [options.assetsUrl] The url to the Braintree asset to be used in frameservice.\n * @param {string} [options.approvalUrl] The url to open for SEPA authorization. It is `approvalUrl` coming back from the mandate creation, but commonly refered to as the mandate link.\n * @param {string} [options.debug] Whether to use debugging modes or not.\n * @returns {Promise} Returns a promise.\n */\n function openPopup(client, options) {\n var popupName = \"sepadirectdebit\";\n var assetsBaseUrl = options.assetsUrl + \"/html\";\n var debug = options.debug || false;\n return new Promise(function (resolve, reject) {\n var popupLocation = centeredPopupDimensions();\n frameService.create({\n name: popupName,\n dispatchFrameUrl: assetsBaseUrl + \"/dispatch-frame\" + useMin(debug) + \".html\",\n openFrameUrl: assetsBaseUrl + \"/sepa-landing-frame\" + useMin(debug) + \".html\",\n top: popupLocation.top,\n left: popupLocation.left,\n height: POPUP_HEIGHT,\n width: POPUP_WIDTH\n }, function (frameServiceInstance) {\n analytics.sendEvent(client, \"sepa.popup.initialized\");\n frameServiceInstance.open({}, function (err, params) {\n if (mandateApproved(params)) {\n frameServiceInstance.close();\n return resolve();\n }\n if (customerCanceled(params, err)) {\n frameServiceInstance.close();\n return reject(new BraintreeError(sepaErrors.SEPA_CUSTOMER_CANCELED));\n }\n frameServiceInstance.close();\n return reject(new BraintreeError(sepaErrors.SEPA_TOKENIZATION_FAILED));\n });\n frameServiceInstance.redirect(options.approvalUrl);\n });\n });\n }\n function mandateApproved(params) {\n return params && params.success;\n }\n function customerCanceled(params, error) {\n return params && params.cancel || error && error.code === \"FRAME_SERVICE_FRAME_CLOSED\";\n }\n function centeredPopupDimensions() {\n var popupTop = Math.round((window.outerHeight - POPUP_HEIGHT) / 2) + window.screenTop;\n var popupLeft = Math.round((window.outerWidth - POPUP_WIDTH) / 2) + window.screenLeft;\n return {\n top: popupTop,\n left: popupLeft\n };\n }\n\n /**\n *\n * A function that creates a mandate so that we can present the mandate to the customer via a popup.\n *\n * @ignore\n * @static\n * @function handleApproval\n * @param {object} client The Braintree client.\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.bankReferenceToken] The tokenized payment source to fun the payment.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.last4] The last four digits of iban.\n * @param {string} [options.mandateType] The mandate type being used. Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {string} [options.merchantId] The merchant id.\n * @returns {Promise} Returns a promise with the approval response or an error.\n */\n\n function handleApproval(client, options) {\n // Disabling eslint because api is expecting snake_case format for the keys\n /* eslint-disable */\n var data = {\n sepa_debit_account: {\n last_4: options.last4,\n merchant_or_partner_customer_id: options.customerId,\n bank_reference_token: options.bankReferenceToken,\n mandate_type: options.mandateType\n },\n merchant_account_id: options.merchantAccountId\n };\n\n /* eslint-enable */\n return client.request({\n api: \"clientApi\",\n method: \"post\",\n endpoint: \"payment_methods/sepa_debit_accounts\",\n data: data\n }).then(function (response) {\n if (!response.nonce) {\n throw new BraintreeError(sepaErrors.SEPA_TRANSACTION_FAILED);\n }\n return {\n nonce: response.nonce,\n ibanLastFour: options.last4,\n customerId: options.customerId,\n mandateType: options.mandateType\n };\n }).catch(function () {\n throw new BraintreeError(sepaErrors.SEPA_TRANSACTION_FAILED);\n });\n }\n module.exports = {\n createMandate: createMandate,\n openPopup: openPopup,\n handleApproval: handleApproval,\n POPUP_WIDTH: POPUP_WIDTH,\n POPUP_HEIGHT: POPUP_HEIGHT\n };\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/braintree-error\": 124,\n \"../../lib/frame-service/external\": 139,\n \"../../lib/snake-case-to-camel-case\": 159,\n \"../../lib/use-min\": 160,\n \"../shared/constants\": 187,\n \"../shared/errors\": 188\n }],\n 185: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var sepaErrors = _dereq_(\"../shared/errors\");\n var constants = _dereq_(\"../shared/constants\");\n var mandates = _dereq_(\"./mandate\");\n var hasMissingOption = _dereq_(\"../shared/has-missing-option\");\n var analytics = _dereq_(\"../../lib/analytics\");\n var VERSION = \"3.101.1\";\n var assign = _dereq_(\"../../lib/assign\").assign;\n\n /**\n * @class\n * @param {object} options see {@link module:braintree-web/sepa.create|sepa.create}\n * @description Do not use this constructor directly. Use {@link module:braintree-web/sepa.create|braintree-web.sepa.create} instead.\n * @classdesc This class represents a SEPA component produced by {@link module:braintree-web/sepa.create|braintree-web.sepa.create}. Instances provide methods for tokenizing SEPA payments.\n */\n function SEPA(options) {\n var getConfiguration = options.client.getConfiguration();\n this._client = options.client;\n this._assetsUrl = getConfiguration.gatewayConfiguration.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = getConfiguration.isDebug;\n this._returnUrl = this._assetsUrl + \"/html/redirect-frame.html?success=1\";\n this._cancelUrl = this._assetsUrl + \"/html/redirect-frame.html?cancel=1\";\n analytics.sendEvent(this._client, \"sepa.component.initialized\");\n }\n\n /**\n * SEPA tokenize payload.\n * @typedef SEPA~tokenizePayload\n * @property {string} nonce The payment nonce.\n * @property {string} ibanLastFour The last four digits of the customer's IBAN.\n * @property {string} mandateType The specified mandateType used.\n * @property {string} customerId The provided customer id.\n */\n\n /**\n * @public\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.accountHolderName] The account holder name.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.iban] The customer's International Bank Account Number.\n * @param {string} [options.mandateType] Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.countryCode] The customer's country code.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {callback} [callback] The first argument is an error object, where the second is a {@link SEPA~tokenizePayload|tokenizePayload}\n * @returns {(Promise)} Returns a promise if no callback is provided.\n *\n * @example\n * button.addEventListener('click', function () {\n * var tokenizeInputs = {\n * accountHolderName: \"some-accnt-holder-name\",\n * customerId: \"a-customer-id\",\n * iban: \"a-full-iban\",\n * mandateType: \"ONE_OFF\",\n * countryCode: \"LI\",\n * merchantAccountId: \"a-merchant-account-id\"\n * }\n * sepaInstance.tokenize(tokenizeInputs).then(function (payload) {\n * // Submit payload.nonce to your server\n * }).catch(function(tokenizationErr) {\n * // Handle errors in the flow\n * })\n * })\n */\n SEPA.prototype.tokenize = function (options) {\n var self = this;\n var createMandateOptions = assign({\n cancelUrl: self._cancelUrl,\n returnUrl: self._returnUrl\n }, options);\n if (!options || hasMissingOption(options, constants.REQUIRED_OPTIONS)) {\n analytics.sendEvent(self._client, \"sepa.input-validation.missing-options\");\n return Promise.reject(new BraintreeError(sepaErrors.SEPA_TOKENIZE_MISSING_REQUIRED_OPTION));\n }\n if (!constants.MANDATE_TYPE_ENUM.includes(options.mandateType)) {\n analytics.sendEvent(self._client, \"sepa.input-validation.invalid-mandate\");\n return Promise.reject(new BraintreeError(sepaErrors.SEPA_INVALID_MANDATE_TYPE));\n }\n return mandates.createMandate(self._client, createMandateOptions).then(function (mandateResponse) {\n analytics.sendEvent(self._client, \"sepa.create-mandate.success\");\n options.last4 = mandateResponse.last4;\n options.bankReferenceToken = mandateResponse.bankReferenceToken;\n return mandates.openPopup(self._client, {\n approvalUrl: mandateResponse.approvalUrl,\n assetsUrl: self._assetsUrl\n });\n }).then(function () {\n analytics.sendEvent(self._client, \"sepa.mandate.approved\");\n return mandates.handleApproval(self._client, {\n bankReferenceToken: options.bankReferenceToken,\n last4: options.last4,\n customerId: options.customerId,\n mandateType: options.mandateType,\n merchantAccountId: options.merchantAccountId\n });\n }).then(function (approval) {\n analytics.sendEvent(self._client, \"sepa.tokenization.success\");\n return Promise.resolve(approval);\n }).catch(function (err) {\n analytics.sendEvent(self._client, \"sepa.\" + err.details + \".failed\");\n return Promise.reject(err);\n });\n };\n module.exports = wrapPromise.wrapPrototype(SEPA);\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/assign\": 121,\n \"../../lib/braintree-error\": 124,\n \"../shared/constants\": 187,\n \"../shared/errors\": 188,\n \"../shared/has-missing-option\": 189,\n \"./mandate\": 184,\n \"@braintree/wrap-promise\": 43\n }],\n 186: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /** @module braintree-web/sepa */\n var analytics = _dereq_(\"../lib/analytics\");\n var SEPA = _dereq_(\"./external/sepa\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var VERSION = \"3.101.1\";\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.debug] A debug flag.\n * @param {callback} [callback] When provided, will be used instead of a promise. First argument is an error object, where the second is an instance of {@link SEPA|SEPA}.\n * @returns {Promise} Returns the SEPA instance.\n * @example\n * braintree.sepa.create({\n * client: clientInstance\n * }).then(function (sepaInstance) {\n * // sepaInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating SEPA instance', createErr);\n * });\n * @example Creating a SEPA component\n * braintree.sepa.create({\n * client: clientInstance,\n * }).then(function (sepaInstance) {\n * // sepaInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating SEPA instance', createErr);\n * });\n */\n\n function create(options) {\n var name = \"SEPA\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n options.client = client;\n analytics.sendEvent(options.client, \"sepa.client.initialized\");\n return new SEPA(options);\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./external/sepa\": 185,\n \"@braintree/wrap-promise\": 43\n }],\n 187: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n REQUIRED_OPTIONS: [\"iban\", \"merchantAccountId\", \"mandateType\", \"customerId\", \"accountHolderName\", \"countryCode\"],\n BILLING_ADDRESS_OPTIONS: [\"address_line_1\", \"address_line_2\", \"admin_area_1\", \"admin_area_2\", \"postal_code\"],\n MANDATE_TYPE_ENUM: [\"ONE_OFF\", \"RECURRENT\"]\n };\n }, {}],\n 188: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\n /**\n * @name BraintreeError.SEPA - tokenize Error Codes\n * @description Errors that occur when using the {@link module:braintree-web/sepa.tokenize|sepa.tokenize} method.\n * @property {MERCHANT} SEPA_CREATE_MANDATE_FAILED Occurs when there was an issue creating a mandate. This can occur if the request fails, or if the merchant does not have SEPA enabled.\n * @property {CUSTOMER} SEPA_CUSTOMER_CANCELED Occurs when the customer has canceled the SEPA authorization process. This can be within the mandate approval popup, or by canceling the popup itself.\n * @property {MERCHANT} SEPA_INVALID_MANDATE_TYPE Occurs when an invalid mandate type is provided.\n * @property {UNKNOWN} SEPA_TOKENIZATION_FAILED Occurs when tokenization fails during the mandate approval process for unknown reasons.\n * @property {MERCHANT} SEPA_TOKENIZE_MISSING_REQUIRED_OPTION Occurs when there are required input options not provided.\n * @property {UNKNOWN} SEPA_TRANSACTION_FAILED Occurs when final tokenization fails.\n */\n\n // Those with a \"details\" property are used in specific locations and this prop serves to identify where in the imlpementation the error originates.\n module.exports = {\n SEPA_CREATE_MANDATE_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_CREATE_MANDATE_FAILED\",\n message: \"SEPA create mandate failed.\",\n details: \"create-mandate\"\n },\n SEPA_CUSTOMER_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"SEPA_CUSTOMER_CANCELED\",\n message: \"User canceled SEPA authorization\",\n details: \"customer-canceled\"\n },\n SEPA_INVALID_MANDATE_TYPE: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_INVALID_MANDATE_TYPE\",\n message: \"SEPA mandate type is invalid\"\n },\n SEPA_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"SEPA_TOKENIZATION_FAILED\",\n message: \"SEPA encountered a problem\",\n details: \"open-popup\"\n },\n SEPA_TOKENIZE_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_TOKENIZE_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for tokenize.\"\n },\n SEPA_TRANSACTION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"SEPA_TRANSACTION_FAILED\",\n message: \"SEPA transaction failed\",\n details: \"handle-approval\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 189: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @ignore\n * @static\n * @function hasMissingOption\n * @param {object} options All options provided for intiating the SEPA payment flow.\n * @param {array} required A list of required inputs that must be include as part of the options.\n * @returns {boolean} Returns a boolean.\n */\n function hasMissingOption(options, required) {\n var i, option;\n required = required || [];\n for (i = 0; i < required.length; i++) {\n option = required[i];\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n return false;\n }\n module.exports = hasMissingOption;\n }, {}],\n 190: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var assign = _dereq_(\"../../../lib/assign\").assign;\n var analytics = _dereq_(\"../../../lib/analytics\");\n var BraintreeError = _dereq_(\"../../../lib/braintree-error\");\n var isVerifiedDomain = _dereq_(\"../../../lib/is-verified-domain\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var EventEmitter = _dereq_(\"@braintree/event-emitter\");\n var errors = _dereq_(\"../../shared/errors\");\n var iFramer = _dereq_(\"@braintree/iframer\");\n var Bus = _dereq_(\"framebus\");\n var constants = _dereq_(\"../../shared/constants\");\n var uuid = _dereq_(\"@braintree/uuid\");\n var events = _dereq_(\"../../shared/events\");\n var useMin = _dereq_(\"../../../lib/use-min\");\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_(\"../../../lib/constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n var VERSION = \"3.101.1\";\n var IFRAME_HEIGHT = 400;\n var IFRAME_WIDTH = 400;\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n function BaseFramework(options) {\n EventEmitter.call(this);\n this._client = options.client;\n this._createPromise = options.createPromise;\n this._createOptions = options;\n if (this._client) {\n this._isDebug = this._client.getConfiguration().isDebug;\n this._assetsUrl = this._client.getConfiguration().gatewayConfiguration.assetsUrl;\n } else {\n this._isDebug = Boolean(options.isDebug);\n this._assetsUrl = options.assetsUrl;\n }\n this._assetsUrl = this._assetsUrl + \"/web/\" + VERSION;\n }\n EventEmitter.createChild(BaseFramework);\n BaseFramework.prototype._waitForClient = function () {\n if (this._client) {\n return Promise.resolve();\n }\n return this._createPromise.then(function (client) {\n this._client = client;\n }.bind(this));\n };\n BaseFramework.prototype.setUpEventListeners = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n BaseFramework.prototype.verifyCard = function (options, privateOptions) {\n var formattedOptions, error;\n var self = this;\n privateOptions = privateOptions || {};\n error = this._checkForVerifyCardError(options, privateOptions);\n if (error) {\n return Promise.reject(error);\n }\n this._verifyCardInProgress = true;\n formattedOptions = this._formatVerifyCardOptions(options);\n return this._formatLookupData(formattedOptions).then(function (data) {\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.started\");\n return self._performLookup(formattedOptions.nonce, data);\n }).then(function (response) {\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.3ds-version.\" + response.lookup.threeDSecureVersion);\n return self._onLookupComplete(response, formattedOptions);\n }).then(function (response) {\n return self.initializeChallengeWithLookupResponse(response, formattedOptions);\n }).then(function (payload) {\n self._resetVerificationState();\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.completed\");\n return payload;\n }).catch(function (err) {\n self._resetVerificationState();\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.failed\");\n return Promise.reject(err);\n });\n };\n BaseFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n BaseFramework.prototype._presentChallenge = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n BaseFramework.prototype.prepareLookup = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n BaseFramework.prototype._resetVerificationState = function () {\n this._verifyCardInProgress = false;\n this._verifyCardPromisePlus = null;\n if (typeof this._reloadThreeDSecure === \"function\") {\n this._reloadThreeDSecure();\n }\n };\n BaseFramework.prototype._performLookup = function (nonce, data) {\n var self = this;\n var url = \"payment_methods/\" + nonce + \"/three_d_secure/lookup\";\n return this._waitForClient().then(function () {\n return self._client.request({\n endpoint: url,\n method: \"post\",\n data: data\n }).catch(function (err) {\n var status = err && err.details && err.details.httpStatus;\n var analyticsMessage = \"three-d-secure.verification-flow.lookup-failed\";\n var lookupError;\n if (status === 404) {\n lookupError = errors.THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR;\n analyticsMessage += \".404\";\n } else if (status === 422) {\n lookupError = errors.THREEDS_LOOKUP_VALIDATION_ERROR;\n analyticsMessage += \".422\";\n } else {\n lookupError = errors.THREEDS_LOOKUP_ERROR;\n }\n analytics.sendEvent(self._createPromise, analyticsMessage);\n return Promise.reject(new BraintreeError({\n type: lookupError.type,\n code: lookupError.code,\n message: lookupError.message,\n details: {\n originalError: err\n }\n }));\n });\n });\n };\n BaseFramework.prototype._checkForVerifyCardError = function (options, privateOptions) {\n var errorOption;\n if (this._verifyCardInProgress === true) {\n return new BraintreeError(errors.THREEDS_AUTHENTICATION_IN_PROGRESS);\n } else if (!options.nonce) {\n errorOption = \"a nonce\";\n } else if (!options.amount) {\n errorOption = \"an amount\";\n }\n if (!errorOption) {\n errorOption = this._checkForFrameworkSpecificVerifyCardErrors(options, privateOptions);\n }\n if (errorOption) {\n return new BraintreeError({\n type: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.type,\n code: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.code,\n message: \"verifyCard options must include \" + errorOption + \".\"\n });\n }\n return null;\n };\n BaseFramework.prototype.initializeChallengeWithLookupResponse = function (lookupResponse, options) {\n var self = this;\n options = options || {};\n this._lookupPaymentMethod = lookupResponse.paymentMethod;\n\n // sets this in the case that initializeChallengeWithLookupResponse is\n // called as a standalone method from a server side lookup. In a normal\n // verifyCard flow, this promise will already exist\n self._verifyCardPromisePlus = self._verifyCardPromisePlus || new ExtendedPromise();\n self._handleLookupResponse(lookupResponse, options);\n return self._verifyCardPromisePlus.then(function (payload) {\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.liability-shifted.\" + String(payload.liabilityShifted));\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.liability-shift-possible.\" + String(payload.liabilityShiftPossible));\n return payload;\n });\n };\n BaseFramework.prototype._handleLookupResponse = function (lookupResponse, options) {\n var challengeShouldBePresented = Boolean(lookupResponse.lookup && lookupResponse.lookup.acsUrl);\n var details;\n analytics.sendEvent(this._createPromise, \"three-d-secure.verification-flow.challenge-presented.\" + String(challengeShouldBePresented));\n if (challengeShouldBePresented) {\n this._presentChallenge(lookupResponse, options);\n } else {\n details = this._formatAuthResponse(lookupResponse.paymentMethod, lookupResponse.threeDSecureInfo);\n details.verificationDetails = lookupResponse.threeDSecureInfo;\n this._verifyCardPromisePlus.resolve(details);\n }\n };\n BaseFramework.prototype._onLookupComplete = function (response) {\n this._lookupPaymentMethod = response.paymentMethod;\n this._verifyCardPromisePlus = new ExtendedPromise();\n return Promise.resolve(response);\n };\n BaseFramework.prototype._formatAuthResponse = function (paymentMethod, threeDSecureInfo) {\n return {\n nonce: paymentMethod.nonce,\n type: paymentMethod.type,\n binData: paymentMethod.binData,\n details: paymentMethod.details,\n description: paymentMethod.description && paymentMethod.description.replace(/\\+/g, \" \"),\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n liabilityShiftPossible: threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n threeDSecureInfo: paymentMethod.threeDSecureInfo\n };\n };\n BaseFramework.prototype._formatVerifyCardOptions = function (options) {\n return assign({}, options);\n };\n BaseFramework.prototype._formatLookupData = function (options) {\n var data = {\n amount: options.amount\n };\n if (options.collectDeviceData === true) {\n data.browserColorDepth = window.screen.colorDepth;\n data.browserJavaEnabled = window.navigator.javaEnabled();\n data.browserJavascriptEnabled = true;\n data.browserLanguage = window.navigator.language;\n data.browserScreenHeight = window.screen.height;\n data.browserScreenWidth = window.screen.width;\n data.browserTimeZone = new Date().getTimezoneOffset();\n data.deviceChannel = \"Browser\";\n }\n return Promise.resolve(data);\n };\n BaseFramework.prototype._handleV1AuthResponse = function (data) {\n var authResponse = JSON.parse(data.auth_response);\n if (authResponse.success) {\n this._verifyCardPromisePlus.resolve(this._formatAuthResponse(authResponse.paymentMethod, authResponse.threeDSecureInfo));\n } else if (authResponse.threeDSecureInfo && authResponse.threeDSecureInfo.liabilityShiftPossible) {\n this._verifyCardPromisePlus.resolve(this._formatAuthResponse(this._lookupPaymentMethod, authResponse.threeDSecureInfo));\n } else {\n this._verifyCardPromisePlus.reject(new BraintreeError({\n type: BraintreeError.types.UNKNOWN,\n code: \"UNKNOWN_AUTH_RESPONSE\",\n message: authResponse.error.message\n }));\n }\n };\n BaseFramework.prototype.cancelVerifyCard = function () {\n var response, threeDSecureInfo;\n this._verifyCardInProgress = false;\n if (!this._lookupPaymentMethod) {\n return Promise.reject(new BraintreeError(errors.THREEDS_NO_VERIFICATION_PAYLOAD));\n }\n threeDSecureInfo = this._lookupPaymentMethod.threeDSecureInfo;\n response = assign({}, this._lookupPaymentMethod, {\n liabilityShiftPossible: threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n verificationDetails: threeDSecureInfo && threeDSecureInfo.verificationDetails\n });\n return Promise.resolve(response);\n };\n BaseFramework.prototype._setupV1Bus = function (options) {\n var clientConfiguration = this._client.getConfiguration();\n var parentURL = window.location.href.split(\"#\")[0];\n var lookupResponse = options.lookupResponse;\n var channel = uuid();\n var bus = new Bus({\n channel: channel,\n verifyDomain: isVerifiedDomain\n });\n var authenticationCompleteBaseUrl = this._assetsUrl + \"/html/three-d-secure-authentication-complete-frame.html?channel=\" + encodeURIComponent(channel) + \"&\";\n bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply({\n clientConfiguration: clientConfiguration,\n nonce: options.nonce,\n acsUrl: lookupResponse.acsUrl,\n pareq: lookupResponse.pareq,\n termUrl: lookupResponse.termUrl + \"&three_d_secure_version=\" + VERSION + \"&authentication_complete_base_url=\" + encodeURIComponent(authenticationCompleteBaseUrl),\n md: lookupResponse.md,\n parentUrl: parentURL\n });\n });\n bus.on(events.AUTHENTICATION_COMPLETE, options.handleAuthResponse);\n return bus;\n };\n BaseFramework.prototype._setupV1Iframe = function (options) {\n var url = this._assetsUrl + \"/html/three-d-secure-bank-frame\" + useMin(this._isDebug) + \".html?showLoader=\" + options.showLoader;\n var bankIframe = iFramer({\n src: url,\n height: IFRAME_HEIGHT,\n width: IFRAME_WIDTH,\n name: constants.LANDING_FRAME_NAME + \"_\" + this._v1Bus.channel,\n title: \"3D Secure Authorization Frame\"\n });\n return bankIframe;\n };\n BaseFramework.prototype._setupV1Elements = function (options) {\n this._v1Bus = this._setupV1Bus(options);\n this._v1Iframe = this._setupV1Iframe(options);\n };\n BaseFramework.prototype._teardownV1Elements = function () {\n if (this._v1Bus) {\n this._v1Bus.teardown();\n this._v1Bus = null;\n }\n if (this._v1Iframe && this._v1Iframe.parentNode) {\n this._v1Iframe.parentNode.removeChild(this._v1Iframe);\n this._v1Iframe = null;\n }\n if (this._onV1Keyup) {\n document.removeEventListener(\"keyup\", this._onV1Keyup);\n this._onV1Keyup = null;\n }\n };\n BaseFramework.prototype.teardown = function () {\n analytics.sendEvent(this._createPromise, \"three-d-secure.teardown-completed\");\n this._teardownV1Elements();\n return Promise.resolve();\n };\n module.exports = BaseFramework;\n }, {\n \"../../../lib/analytics\": 119,\n \"../../../lib/assign\": 121,\n \"../../../lib/braintree-error\": 124,\n \"../../../lib/constants\": 126,\n \"../../../lib/is-verified-domain\": 153,\n \"../../../lib/use-min\": 160,\n \"../../shared/constants\": 199,\n \"../../shared/errors\": 200,\n \"../../shared/events\": 201,\n \"@braintree/event-emitter\": 33,\n \"@braintree/extended-promise\": 34,\n \"@braintree/iframer\": 35,\n \"@braintree/uuid\": 39,\n \"framebus\": 52\n }],\n 191: [function (_dereq_, module, exports) {\n \"use strict\";\n\n // NEXT_MAJOR_VERSION drop support for Bootstrap framework,\n // recomend using inline frame version and putting it in\n // the merchant's own bootstrap modal\n var SongbirdFramework = _dereq_(\"./songbird\");\n function Bootstrap3ModalFramework(options) {\n SongbirdFramework.call(this, options);\n }\n Bootstrap3ModalFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n Bootstrap3ModalFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement(\"div\");\n modal.innerHTML = '
' + '
' + '
' + '
' + '' + \"
\" + \"
\" + \"
\" + '
' + \"
\";\n modal.querySelector(\"[data-braintree-v1-fallback-iframe-container]\").appendChild(iframe);\n return modal;\n };\n Bootstrap3ModalFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var options = SongbirdFramework.prototype._createCardinalConfigurationOptions.call(this, setupOptions);\n options.payment.framework = \"bootstrap3\";\n return options;\n };\n module.exports = Bootstrap3ModalFramework;\n }, {\n \"./songbird\": 196\n }],\n 192: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var SongbirdFramework = _dereq_(\"./songbird\");\n function CardinalModalFramework(options) {\n SongbirdFramework.call(this, options);\n }\n CardinalModalFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n CardinalModalFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement(\"div\");\n var addCloseButton = Boolean(this._createOptions && this._createOptions.cardinalSDKConfig && this._createOptions.cardinalSDKConfig.payment && this._createOptions.cardinalSDKConfig.payment.displayExitButton);\n modal.innerHTML = '
' + \"
\" + \"\" + \"
\" +\n // iframe container\n '
' + \"
\" +\n // modal backdrop\n '
';\n if (!addCloseButton) {\n modal.querySelector(\"[data-braintree-v1-fallback-close-button]\").style.display = \"none\";\n }\n modal.querySelector(\"[data-braintree-v1-fallback-iframe-container]\").appendChild(iframe);\n return modal;\n };\n module.exports = CardinalModalFramework;\n }, {\n \"./songbird\": 196\n }],\n 193: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var LegacyFramework = _dereq_(\"./legacy\");\n var CardinalModalFramework = _dereq_(\"./cardinal-modal\");\n var Bootstrap3ModalFramework = _dereq_(\"./bootstrap3-modal\");\n var InlineIframeFramework = _dereq_(\"./inline-iframe\");\n module.exports = {\n legacy: LegacyFramework,\n \"cardinal-modal\": CardinalModalFramework,\n \"bootstrap3-modal\": Bootstrap3ModalFramework,\n \"inline-iframe\": InlineIframeFramework\n };\n }, {\n \"./bootstrap3-modal\": 191,\n \"./cardinal-modal\": 192,\n \"./inline-iframe\": 194,\n \"./legacy\": 195\n }],\n 194: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var SongbirdFramework = _dereq_(\"./songbird\");\n var BraintreeError = _dereq_(\"../../../lib/braintree-error\");\n var errors = _dereq_(\"../../shared/errors\");\n var enumerate = _dereq_(\"../../../lib/enumerate\");\n function InlineIframeFramework(options) {\n SongbirdFramework.call(this, options);\n }\n InlineIframeFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework\n });\n InlineIframeFramework.events = enumerate([\"AUTHENTICATION_IFRAME_AVAILABLE\"], \"inline-iframe-framework:\");\n InlineIframeFramework.prototype.setUpEventListeners = function (reply) {\n SongbirdFramework.prototype.setUpEventListeners.call(this, reply);\n this.on(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, function (payload, next) {\n reply(\"authentication-iframe-available\", payload, next);\n });\n };\n InlineIframeFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var options = SongbirdFramework.prototype._createCardinalConfigurationOptions.call(this, setupOptions);\n options.payment.framework = \"inline\";\n return options;\n };\n InlineIframeFramework.prototype._addV1IframeToPage = function () {\n this._emit(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, {\n element: this._v1Modal\n }, function () {\n // NOOP\n });\n };\n InlineIframeFramework.prototype._setupFrameworkSpecificListeners = function () {\n this.setCardinalListener(\"ui.inline.setup\", this._onInlineSetup.bind(this));\n };\n InlineIframeFramework.prototype._onInlineSetup = function (htmlTemplate, details, resolve, reject) {\n var container, hasError;\n if (!htmlTemplate || !details) {\n hasError = true;\n } else if (details.paymentType !== \"CCA\") {\n hasError = true;\n } else if (!(details.data.mode === \"suppress\" || details.data.mode === \"static\")) {\n hasError = true;\n }\n if (hasError) {\n reject(new BraintreeError(errors.THREEDS_INLINE_IFRAME_DETAILS_INCORRECT));\n return;\n }\n container = document.createElement(\"div\");\n container.innerHTML = htmlTemplate;\n if (details.data.mode === \"suppress\") {\n container.style.display = \"none\";\n document.body.appendChild(container);\n resolve();\n } else if (details.data.mode === \"static\") {\n this._emit(InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE, {\n element: container\n }, function () {\n resolve();\n });\n }\n };\n module.exports = InlineIframeFramework;\n }, {\n \"../../../lib/braintree-error\": 124,\n \"../../../lib/enumerate\": 134,\n \"../../shared/errors\": 200,\n \"./songbird\": 196\n }],\n 195: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BaseFramework = _dereq_(\"./base\");\n var deferred = _dereq_(\"../../../lib/deferred\");\n function LegacyFramework(options) {\n BaseFramework.call(this, options);\n }\n LegacyFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: LegacyFramework\n });\n LegacyFramework.prototype.setUpEventListeners = function () {\n // noop\n };\n LegacyFramework.prototype.transformV1CustomerBillingAddress = function (customer) {\n customer.billingAddress.line1 = customer.billingAddress.streetAddress;\n customer.billingAddress.line2 = customer.billingAddress.extendedAddress;\n customer.billingAddress.city = customer.billingAddress.locality;\n customer.billingAddress.state = customer.billingAddress.region;\n customer.billingAddress.countryCode = customer.billingAddress.countryCodeAlpha2;\n delete customer.billingAddress.streetAddress;\n delete customer.billingAddress.extendedAddress;\n delete customer.billingAddress.locality;\n delete customer.billingAddress.region;\n delete customer.billingAddress.countryCodeAlpha2;\n return customer;\n };\n LegacyFramework.prototype._createIframe = function (options) {\n var self = this;\n this._setupV1Elements({\n nonce: options.nonce,\n lookupResponse: options.lookupResponse,\n showLoader: options.showLoader,\n handleAuthResponse: function (data) {\n self._handleAuthResponse(data, options);\n }\n });\n return this._v1Iframe;\n };\n LegacyFramework.prototype._handleAuthResponse = function (data, options) {\n this._v1Bus.teardown();\n options.removeFrame();\n\n // This also has to be in a setTimeout so it executes after the `removeFrame`.\n deferred(function () {\n this._handleV1AuthResponse(data);\n }.bind(this))();\n };\n LegacyFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function (options) {\n var errorOption;\n if (typeof options.addFrame !== \"function\") {\n errorOption = \"an addFrame function\";\n } else if (typeof options.removeFrame !== \"function\") {\n errorOption = \"a removeFrame function\";\n }\n return errorOption;\n };\n LegacyFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(this, options);\n modifiedOptions.addFrame = deferred(options.addFrame);\n modifiedOptions.removeFrame = deferred(options.removeFrame);\n modifiedOptions.showLoader = options.showLoader !== false;\n return modifiedOptions;\n };\n LegacyFramework.prototype._formatLookupData = function (options) {\n var self = this;\n return BaseFramework.prototype._formatLookupData.call(this, options).then(function (data) {\n if (options.customer && options.customer.billingAddress) {\n data.customer = self.transformV1CustomerBillingAddress(options.customer);\n }\n return data;\n });\n };\n LegacyFramework.prototype._presentChallenge = function (lookupResponse, options) {\n options.addFrame(null, this._createIframe({\n showLoader: options.showLoader,\n lookupResponse: lookupResponse.lookup,\n nonce: lookupResponse.paymentMethod.nonce,\n removeFrame: options.removeFrame\n }));\n };\n module.exports = LegacyFramework;\n }, {\n \"../../../lib/deferred\": 132,\n \"./base\": 190\n }],\n 196: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BaseFramework = _dereq_(\"./base\");\n var assign = _dereq_(\"../../../lib/assign\").assign;\n var deferred = _dereq_(\"../../../lib/deferred\");\n var BraintreeError = _dereq_(\"../../../lib/braintree-error\");\n var convertToBraintreeError = _dereq_(\"../../../lib/convert-to-braintree-error\");\n var analytics = _dereq_(\"../../../lib/analytics\");\n var assets = _dereq_(\"../../../lib/assets\");\n var errors = _dereq_(\"../../shared/errors\");\n var enumerate = _dereq_(\"../../../lib/enumerate\");\n var constants = _dereq_(\"../../shared/constants\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var INTEGRATION_TIMEOUT_MS = _dereq_(\"../../../lib/constants\").INTEGRATION_TIMEOUT_MS;\n var PLATFORM = _dereq_(\"../../../lib/constants\").PLATFORM;\n var VERSION = \"3.101.1\";\n var CUSTOMER_CANCELED_SONGBIRD_MODAL = \"01\";\n var SONGBIRD_UI_EVENTS = [\"ui.close\", \"ui.render\",\n // TODO these events are not documented in the\n // client reference because so far we have\n // not been able to trigger them in our testing\n \"ui.renderHidden\", \"ui.loading.close\", \"ui.loading.render\"];\n var SCA_EXEMPTION_TYPES = [\"low_value\", \"transaction_risk_analysis\"];\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n function SongbirdFramework(options) {\n BaseFramework.call(this, options);\n this._songbirdInitFailed = false;\n this._clientMetadata = {\n requestedThreeDSecureVersion: \"2\",\n sdkVersion: PLATFORM + \"/\" + VERSION\n };\n this.originalSetupOptions = options;\n this._getDfReferenceIdPromisePlus = new ExtendedPromise();\n this.setupSongbird(options);\n this._cardinalEvents = [];\n }\n SongbirdFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: SongbirdFramework\n });\n SongbirdFramework.events = enumerate([\"LOOKUP_COMPLETE\", \"CUSTOMER_CANCELED\", \"UI.CLOSE\", \"UI.RENDER\", \"UI.RENDERHIDDEN\", \"UI.LOADING.CLOSE\", \"UI.LOADING.RENDER\"], \"songbird-framework:\");\n SongbirdFramework.prototype.setUpEventListeners = function (reply) {\n this.on(SongbirdFramework.events.LOOKUP_COMPLETE, function (data, next) {\n reply(\"lookup-complete\", data, next);\n });\n this.on(SongbirdFramework.events.CUSTOMER_CANCELED, function () {\n reply(\"customer-canceled\");\n });\n this.on(SongbirdFramework.events[\"UI.CLOSE\"], function () {\n reply(\"authentication-modal-close\");\n });\n this.on(SongbirdFramework.events[\"UI.RENDER\"], function () {\n reply(\"authentication-modal-render\");\n });\n this.on(SongbirdFramework.events[\"UI.RENDERHIDDEN\"], function () {\n reply(\"authentication-modal-render-hidden\");\n });\n this.on(SongbirdFramework.events[\"UI.LOADING.CLOSE\"], function () {\n reply(\"authentication-modal-loader-close\");\n });\n this.on(SongbirdFramework.events[\"UI.LOADING.RENDER\"], function () {\n reply(\"authentication-modal-loader-render\");\n });\n };\n SongbirdFramework.prototype.prepareLookup = function (options) {\n var data = assign({}, options);\n var self = this;\n return this.getDfReferenceId().then(function (id) {\n data.dfReferenceId = id;\n }).then(function () {\n return self._triggerCardinalBinProcess(options.bin);\n }).catch(function () {\n // catch and ignore errors from looking up\n // df reference and Cardinal bin process\n }).then(function () {\n return self._waitForClient();\n }).then(function () {\n data.clientMetadata = self._clientMetadata;\n data.authorizationFingerprint = self._client.getConfiguration().authorizationFingerprint;\n data.braintreeLibraryVersion = \"braintree/web/\" + VERSION;\n return data;\n });\n };\n SongbirdFramework.prototype.initializeChallengeWithLookupResponse = function (lookupResponse, options) {\n return this.setupSongbird().then(function () {\n return BaseFramework.prototype.initializeChallengeWithLookupResponse.call(this, lookupResponse, options);\n }.bind(this));\n };\n SongbirdFramework.prototype.handleSongbirdError = function (errorType) {\n this._songbirdInitFailed = true;\n this._removeSongbirdListeners();\n analytics.sendEvent(this._createPromise, \"three-d-secure.cardinal-sdk.songbird-error.\" + errorType);\n if (this._songbirdPromise) {\n this._songbirdPromise.resolve();\n }\n };\n SongbirdFramework.prototype._triggerCardinalBinProcess = function (bin) {\n var self = this;\n var issuerStartTime = Date.now();\n return window.Cardinal.trigger(\"bin.process\", bin).then(function (binResults) {\n self._clientMetadata.issuerDeviceDataCollectionTimeElapsed = Date.now() - issuerStartTime;\n self._clientMetadata.issuerDeviceDataCollectionResult = binResults && binResults.Status;\n });\n };\n SongbirdFramework.prototype.transformBillingAddress = function (additionalInformation, billingAddress) {\n if (billingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(billingAddress, additionalInformation, \"billing\");\n additionalInformation.billingPhoneNumber = billingAddress.phoneNumber;\n additionalInformation.billingGivenName = billingAddress.givenName;\n additionalInformation.billingSurname = billingAddress.surname;\n }\n return additionalInformation;\n };\n SongbirdFramework.prototype.transformShippingAddress = function (additionalInformation) {\n var shippingAddress = additionalInformation.shippingAddress;\n if (shippingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(shippingAddress, additionalInformation, \"shipping\");\n delete additionalInformation.shippingAddress;\n }\n return additionalInformation;\n };\n SongbirdFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement(\"div\");\n modal.innerHTML = '
';\n modal.querySelector('[data-braintree-v1-fallback-iframe-container=\"true\"]').appendChild(iframe);\n return modal;\n };\n SongbirdFramework.prototype._createV1IframeModal = function (iframe) {\n var modal = this._createV1IframeModalElement(iframe);\n var btn = modal.querySelector(\"[data-braintree-v1-fallback-close-button]\");\n var backdrop = modal.querySelector(\"[data-braintree-v1-fallback-backdrop]\");\n var self = this;\n function closeHandler() {\n modal.parentNode.removeChild(modal);\n self.cancelVerifyCard(errors.THREEDS_CARDINAL_SDK_CANCELED);\n document.removeEventListener(\"keyup\", self._onV1Keyup);\n self._onV1Keyup = null;\n }\n this._onV1Keyup = function (e) {\n if (e.key !== \"Escape\") {\n return;\n }\n if (!modal.parentNode) {\n // modal not on page\n return;\n }\n closeHandler();\n };\n if (btn) {\n btn.addEventListener(\"click\", closeHandler);\n }\n if (backdrop) {\n backdrop.addEventListener(\"click\", closeHandler);\n }\n document.addEventListener(\"keyup\", this._onV1Keyup);\n return modal;\n };\n SongbirdFramework.prototype._addV1IframeToPage = function () {\n document.body.appendChild(this._v1Modal);\n };\n SongbirdFramework.prototype.setupSongbird = function (setupOptions) {\n var self = this;\n var startTime = Date.now();\n if (this._songbirdPromise) {\n return this._songbirdPromise;\n }\n setupOptions = setupOptions || {};\n this._songbirdPromise = new ExtendedPromise();\n this._v2SetupFailureReason = \"reason-unknown\";\n self._loadCardinalScript(setupOptions).then(function () {\n if (!window.Cardinal) {\n self._v2SetupFailureReason = \"cardinal-global-unavailable\";\n return Promise.reject(new BraintreeError(errors.THREEDS_CARDINAL_SDK_SETUP_FAILED));\n }\n return self._configureCardinalSdk({\n setupOptions: setupOptions,\n setupStartTime: startTime\n });\n }).catch(function (err) {\n var error = convertToBraintreeError(err, {\n type: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.type,\n code: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.code,\n message: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.message\n });\n self._getDfReferenceIdPromisePlus.reject(error);\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(self._client, \"three-d-secure.cardinal-sdk.init.setup-failed\");\n self.handleSongbirdError(\"cardinal-sdk-setup-failed.\" + self._v2SetupFailureReason);\n });\n return this._songbirdPromise;\n };\n SongbirdFramework.prototype._configureCardinalSdk = function (config) {\n var self = this;\n return this._waitForClient().then(function () {\n var threeDSConfig = self._client.getConfiguration().gatewayConfiguration.threeDSecure;\n return threeDSConfig;\n }).then(function (threeDSConfig) {\n var jwt = threeDSConfig.cardinalAuthenticationJWT;\n var setupOptions = config.setupOptions;\n var setupStartTime = config.setupStartTime;\n var cardinalConfiguration = self._createCardinalConfigurationOptions(setupOptions);\n SONGBIRD_UI_EVENTS.forEach(function (eventName) {\n self.setCardinalListener(eventName, function () {\n self._emit(SongbirdFramework.events[eventName.toUpperCase()]);\n });\n });\n self.setCardinalListener(\"payments.setupComplete\", self._createPaymentsSetupCompleteCallback());\n self._setupFrameworkSpecificListeners();\n window.Cardinal.configure(cardinalConfiguration);\n window.Cardinal.setup(\"init\", {\n jwt: jwt\n });\n self._clientMetadata.cardinalDeviceDataCollectionTimeElapsed = Date.now() - setupStartTime;\n self.setCardinalListener(\"payments.validated\", self._createPaymentsValidatedCallback());\n }).catch(function (err) {\n self._v2SetupFailureReason = \"cardinal-configuration-threw-error\";\n return Promise.reject(err);\n });\n };\n SongbirdFramework.prototype.setCardinalListener = function (eventName, cb) {\n this._cardinalEvents.push(eventName);\n window.Cardinal.on(eventName, cb);\n };\n SongbirdFramework.prototype._setupFrameworkSpecificListeners = function () {\n // noop\n };\n SongbirdFramework.prototype._createCardinalConfigurationOptions = function (setupOptions) {\n var cardinalConfiguration = setupOptions.cardinalSDKConfig || {};\n var paymentSettings = cardinalConfiguration.payment || {};\n if (!cardinalConfiguration.logging && setupOptions.loggingEnabled) {\n cardinalConfiguration.logging = {\n level: \"verbose\"\n };\n }\n cardinalConfiguration.payment = {};\n if (paymentSettings.hasOwnProperty(\"displayLoading\")) {\n cardinalConfiguration.payment.displayLoading = paymentSettings.displayLoading;\n }\n if (paymentSettings.hasOwnProperty(\"displayExitButton\")) {\n cardinalConfiguration.payment.displayExitButton = paymentSettings.displayExitButton;\n }\n return cardinalConfiguration;\n };\n SongbirdFramework.prototype._loadCardinalScript = function (setupOptions) {\n var self = this;\n return this._waitForClient().then(function () {\n var scriptSource = self._getCardinalScriptSource();\n self._songbirdSetupTimeoutReference = window.setTimeout(function () {\n analytics.sendEvent(self._client, \"three-d-secure.cardinal-sdk.init.setup-timeout\");\n self.handleSongbirdError(\"cardinal-sdk-setup-timeout\");\n }, setupOptions.timeout || INTEGRATION_TIMEOUT_MS);\n return assets.loadScript({\n src: scriptSource\n });\n }).catch(function (err) {\n self._v2SetupFailureReason = \"songbird-js-failed-to-load\";\n return Promise.reject(convertToBraintreeError(err, errors.THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED));\n });\n };\n SongbirdFramework.prototype._getCardinalScriptSource = function () {\n var gatewayConfig = this._client.getConfiguration().gatewayConfiguration;\n if (gatewayConfig && gatewayConfig.environment === \"production\") {\n return constants.CARDINAL_SCRIPT_SOURCE.production;\n }\n return constants.CARDINAL_SCRIPT_SOURCE.sandbox;\n };\n SongbirdFramework.prototype._createPaymentsSetupCompleteCallback = function () {\n var self = this;\n return function (data) {\n self._getDfReferenceIdPromisePlus.resolve(data.sessionId);\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(self._createPromise, \"three-d-secure.cardinal-sdk.init.setup-completed\");\n self._songbirdPromise.resolve();\n };\n };\n SongbirdFramework.prototype.getDfReferenceId = function () {\n return this._getDfReferenceIdPromisePlus;\n };\n SongbirdFramework.prototype._performJWTValidation = function (rawCardinalSDKVerificationData, jwt) {\n var self = this;\n var nonce = this._lookupPaymentMethod.nonce;\n var url = \"payment_methods/\" + nonce + \"/three_d_secure/authenticate_from_jwt\";\n var cancelCode = rawCardinalSDKVerificationData && rawCardinalSDKVerificationData.Payment && rawCardinalSDKVerificationData.Payment.ExtendedData && rawCardinalSDKVerificationData.Payment.ExtendedData.ChallengeCancel;\n if (cancelCode) {\n // see ChallengeCancel docs here for different values:\n // https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects\n analytics.sendEvent(this._createPromise, \"three-d-secure.verification-flow.cardinal-sdk.cancel-code.\" + cancelCode);\n if (cancelCode === CUSTOMER_CANCELED_SONGBIRD_MODAL) {\n this._emit(SongbirdFramework.events.CUSTOMER_CANCELED);\n }\n }\n analytics.sendEvent(this._createPromise, \"three-d-secure.verification-flow.upgrade-payment-method.started\");\n return this._waitForClient().then(function () {\n return self._client.request({\n method: \"post\",\n endpoint: url,\n data: {\n jwt: jwt,\n paymentMethodNonce: nonce\n }\n });\n }).then(function (response) {\n var paymentMethod = response.paymentMethod || self._lookupPaymentMethod;\n var formattedResponse = self._formatAuthResponse(paymentMethod, response.threeDSecureInfo);\n formattedResponse.rawCardinalSDKVerificationData = rawCardinalSDKVerificationData;\n analytics.sendEvent(self._client, \"three-d-secure.verification-flow.upgrade-payment-method.succeeded\");\n return Promise.resolve(formattedResponse);\n }).catch(function (err) {\n var error = new BraintreeError({\n type: errors.THREEDS_JWT_AUTHENTICATION_FAILED.type,\n code: errors.THREEDS_JWT_AUTHENTICATION_FAILED.code,\n message: errors.THREEDS_JWT_AUTHENTICATION_FAILED.message,\n details: {\n originalError: err\n }\n });\n analytics.sendEvent(self._client, \"three-d-secure.verification-flow.upgrade-payment-method.errored\");\n return Promise.reject(error);\n });\n };\n SongbirdFramework.prototype._createPaymentsValidatedCallback = function () {\n var self = this;\n\n /**\n * @param {object} data Response Data\n * @see {@link https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects#ResponseObjects-ObjectDefinition}\n * @param {string} data.ActionCode The resulting state of the transaction.\n * @param {boolean} data.Validated Represents whether transaction was successfully or not.\n * @param {object} data.Payment Represents additional information about the verification.\n * @param {number} data.ErrorNumber A non-zero value represents the error encountered while attempting the process the message request.\n * @param {string} data.ErrorDescription Application error description for the associated error number.\n * @param {string} validatedJwt Response JWT\n * @returns {void}\n * */\n return function (data, validatedJwt) {\n var formattedError;\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.cardinal-sdk.action-code.\" + data.ActionCode.toLowerCase());\n if (!self._verifyCardPromisePlus) {\n self.handleSongbirdError(\"cardinal-sdk-setup-error.number-\" + data.ErrorNumber);\n return;\n }\n switch (data.ActionCode) {\n // Handle these scenarios based on liability shift information in the response.\n case \"SUCCESS\":\n case \"NOACTION\":\n case \"FAILURE\":\n self._performJWTValidation(data, validatedJwt).then(function (result) {\n self._verifyCardPromisePlus.resolve(result);\n }).catch(function (err) {\n self._verifyCardPromisePlus.reject(err);\n });\n break;\n case \"ERROR\":\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.cardinal-sdk-error.\" + data.ErrorNumber);\n switch (data.ErrorNumber) {\n case 10001: // Cardinal Docs: Timeout when sending an /Init message\n case 10002:\n // Cardinal Docs: Timeout when sending an /Start message\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT);\n break;\n case 10003: // Cardinal Docs: Timeout when sending an /Validate message. Although this code exists we do not yet have a flow where a validate message is sent to Midas. This error should not yet be triggered\n case 10007: // Cardinal Docs: Timeout when sending an /Confirm message\n case 10009:\n // Cardinal Docs: Timeout when sending an /Continue message\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT);\n break;\n case 10005: // Cardinal Docs: Songbird was started without a request jwt.\n case 10006:\n // Cardinal Docs: This is a general configuration error. The description is populated by the specific configuration error that caused the error.\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_BAD_CONFIG);\n break;\n case 10008: // Cardinal Docs: Songbird was initialized without a merchant JWT.\n case 10010:\n // Cardinal Docs: The response JWT was\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_BAD_JWT);\n break;\n case 10011:\n // This may never get called, according to the Cardinal docs:\n // The user has canceled the transaction. This is generally found in alternative\n // payments that supply a cancel button on the payment brand side.\n analytics.sendEvent(self._createPromise, \"three-d-secure.verification-flow.canceled\");\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_CANCELED);\n break;\n default:\n formattedError = new BraintreeError(errors.THREEDS_CARDINAL_SDK_ERROR);\n }\n formattedError.details = {\n originalError: {\n code: data.ErrorNumber,\n description: data.ErrorDescription\n }\n };\n self._verifyCardPromisePlus.reject(formattedError);\n break;\n default:\n }\n };\n };\n SongbirdFramework.prototype._checkForVerifyCardError = function (options, privateOptions) {\n if (!options.bin) {\n return new BraintreeError({\n type: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.type,\n code: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.code,\n message: \"verifyCard options must include a BIN.\"\n });\n }\n return BaseFramework.prototype._checkForVerifyCardError.call(this, options, privateOptions);\n };\n SongbirdFramework.prototype._checkForFrameworkSpecificVerifyCardErrors = function (options, privateOptions) {\n var errorOption;\n if (typeof options.onLookupComplete !== \"function\" && !privateOptions.ignoreOnLookupCompleteRequirement) {\n errorOption = \"an onLookupComplete function\";\n }\n return errorOption;\n };\n SongbirdFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(this, options);\n var additionalInformation = modifiedOptions.additionalInformation || {};\n additionalInformation = this.transformBillingAddress(additionalInformation, options.billingAddress);\n additionalInformation = this.transformShippingAddress(additionalInformation);\n if (options.onLookupComplete) {\n modifiedOptions.onLookupComplete = deferred(options.onLookupComplete);\n }\n if (options.email) {\n additionalInformation.email = options.email;\n }\n if (options.mobilePhoneNumber) {\n additionalInformation.mobilePhoneNumber = options.mobilePhoneNumber;\n }\n modifiedOptions.additionalInformation = additionalInformation;\n return modifiedOptions;\n };\n SongbirdFramework.prototype._onLookupComplete = function (lookupResponse, options) {\n var self = this;\n return BaseFramework.prototype._onLookupComplete.call(this, lookupResponse).then(function (response) {\n return new Promise(function (resolve, reject) {\n // NEXT_MAJOR_VERSION format this response object to look like the mobile sdk response\n // which is basically the lookup param at the top level with some additional accessors\n response.requiresUserAuthentication = Boolean(response.lookup && response.lookup.acsUrl);\n function next() {\n resolve(response);\n }\n self._verifyCardPromisePlus.catch(reject);\n\n // If both event and callback are mistakenly used together,\n // prefer the callback when it is passed into the verifyCard options\n if (options.onLookupComplete) {\n options.onLookupComplete(response, next);\n } else {\n self._emit(SongbirdFramework.events.LOOKUP_COMPLETE, response, next);\n }\n });\n });\n };\n SongbirdFramework.prototype._presentChallenge = function (lookupResponse) {\n // transactionId is required for the Songbird flow, so if it\n // does not exist, we just return\n if (this._songbirdInitFailed || !lookupResponse.lookup.transactionId) {\n return;\n }\n\n // set up listener for ref id to call out to bt before calling verify callback\n window.Cardinal.continue(\"cca\", {\n AcsUrl: lookupResponse.lookup.acsUrl,\n Payload: lookupResponse.lookup.pareq\n }, {\n OrderDetails: {\n TransactionId: lookupResponse.lookup.transactionId\n }\n });\n };\n SongbirdFramework.prototype._formatLookupData = function (options) {\n var self = this;\n return BaseFramework.prototype._formatLookupData.call(this, options).then(function (data) {\n data.additionalInfo = options.additionalInformation;\n if (options.accountType) {\n data.accountType = options.accountType;\n }\n if (options.challengeRequested) {\n data.challengeRequested = options.challengeRequested;\n }\n if (options.requestedExemptionType) {\n if (!SCA_EXEMPTION_TYPES.includes(options.requestedExemptionType)) {\n throw new BraintreeError({\n code: errors.THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID.code,\n type: errors.THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID.type,\n message: \"requestedExemptionType `\" + options.requestedExemptionType + \"` is not a valid exemption. The accepted values are: `\" + SCA_EXEMPTION_TYPES.join(\"`, `\") + \"`\"\n });\n }\n data.requestedExemptionType = options.requestedExemptionType;\n }\n if (options.customFields) {\n data.customFields = options.customFields;\n }\n if (options.dataOnlyRequested) {\n data.dataOnlyRequested = options.dataOnlyRequested;\n }\n if (options.exemptionRequested) {\n data.exemptionRequested = options.exemptionRequested;\n }\n if (options.requestVisaDAF) {\n data.requestVisaDAF = options.requestVisaDAF;\n }\n if (options.bin) {\n data.bin = options.bin;\n }\n // NEXT_MAJOR_VERSION remove cardAdd in favor of cardAddChallengeRequested\n if (options.cardAdd != null) {\n data.cardAdd = options.cardAdd;\n }\n if (options.cardAddChallengeRequested != null) {\n data.cardAdd = options.cardAddChallengeRequested;\n }\n if (options.merchantName) {\n data.merchantName = options.merchantName;\n }\n return self.prepareLookup(data);\n });\n };\n SongbirdFramework.prototype.cancelVerifyCard = function (verifyCardError) {\n var self = this;\n return BaseFramework.prototype.cancelVerifyCard.call(this).then(function (response) {\n if (self._verifyCardPromisePlus) {\n verifyCardError = verifyCardError || new BraintreeError(errors.THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT);\n self._verifyCardPromisePlus.reject(verifyCardError);\n }\n return response;\n });\n };\n SongbirdFramework.prototype._removeSongbirdListeners = function () {\n this._cardinalEvents.forEach(function (eventName) {\n window.Cardinal.off(eventName);\n });\n this._cardinalEvents = [];\n };\n SongbirdFramework.prototype.teardown = function () {\n if (window.Cardinal) {\n this._removeSongbirdListeners();\n }\n\n // we intentionally do not remove the Cardinal SDK\n // from the page when tearing down. Subsequent\n // component creations will be faster because\n // the asset is already on the page\n\n return BaseFramework.prototype.teardown.call(this);\n };\n SongbirdFramework.prototype._reloadThreeDSecure = function () {\n var self = this;\n var startTime = Date.now();\n return self.teardown().then(function () {\n self._configureCardinalSdk({\n setupOptions: self.originalSetupOptions,\n setupStartTime: startTime\n });\n });\n };\n function extractAddressData(source, target, prefix) {\n target[prefix + \"Line1\"] = source.streetAddress;\n target[prefix + \"Line2\"] = source.extendedAddress;\n target[prefix + \"Line3\"] = source.line3;\n target[prefix + \"City\"] = source.locality;\n target[prefix + \"State\"] = source.region;\n target[prefix + \"PostalCode\"] = source.postalCode;\n target[prefix + \"CountryCode\"] = source.countryCodeAlpha2;\n }\n module.exports = SongbirdFramework;\n }, {\n \"../../../lib/analytics\": 119,\n \"../../../lib/assets\": 120,\n \"../../../lib/assign\": 121,\n \"../../../lib/braintree-error\": 124,\n \"../../../lib/constants\": 126,\n \"../../../lib/convert-to-braintree-error\": 128,\n \"../../../lib/deferred\": 132,\n \"../../../lib/enumerate\": 134,\n \"../../shared/constants\": 199,\n \"../../shared/errors\": 200,\n \"./base\": 190,\n \"@braintree/extended-promise\": 34\n }],\n 197: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var methods = _dereq_(\"../../lib/methods\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var EventEmitter = _dereq_(\"@braintree/event-emitter\");\n var FRAMEWORKS = _dereq_(\"./frameworks\");\n\n /**\n * @deprecated\n * @callback ThreeDSecure~addFrameCallback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {HTMLIFrameElement} iframe An iframe element containing the bank's authentication page that you must put on your page.\n * @description **Deprecated** The callback used for options.addFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n /**\n * @deprecated\n * @callback ThreeDSecure~removeFrameCallback\n * @description **Deprecated** The callback used for options.removeFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n /**\n * @deprecated\n * @typedef {object} ThreeDSecure~verifyCardCustomerObject\n * @property {string} [customer.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [customer.email] The email used for verification.\n * @property {string} [customer.shippingMethod] The 2-digit string indicating the shipping method chosen for the transaction.\n * @property {string} [customer.billingAddress.firstName] The first name associated with the address.\n * @property {string} [customer.billingAddress.lastName] The last name associated with the address.\n * @property {string} [customer.billingAddress.streetAddress] Line 1 of the Address (eg. number, street, etc).\n * @property {string} [customer.billingAddress.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.).\n * @property {string} [customer.billingAddress.locality] The locality (city) name associated with the address.\n * @property {string} [customer.billingAddress.region] The 2 letter code for US states or an ISO-3166-2 country subdivision code of up to three letters.\n * @property {string} [customer.billingAddress.postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [customer.billingAddress.countryCodeAlpha2] The 2 character country code.\n * @property {string} [customer.billingAddress.phoneNumber] The phone number associated with the address. Only numbers; remove dashes, parenthesis and other characters.\n * @description **Deprecated** Optional customer information to be passed to 3DS 1.0 for verification.\n */\n\n /**\n * @typedef {object} ThreeDSecure~verifyPayload\n * @property {string} nonce The new payment method nonce produced by the 3D Secure lookup. The original nonce passed into {@link ThreeDSecure#verifyCard|verifyCard} was consumed. This new nonce should be used to transact on your server.\n * @property {string} type The payment method type.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n * @property {boolean} liabilityShiftPossible *Deprecated:* Use `threeDSecureInfo.liabilityShiftPossible` instead.\n * @property {boolean} liabilityShifted *Deprecated:* Use `threeDSecureInfo.liabilityShifted` instead.\n * @property {object} threeDSecureInfo 3DS information about the card. Note: This information should be verified on the server by using the [payment method nonce find method](https://developer.paypal.com/braintree/docs/reference/request/payment-method-nonce/find). The values provided here are merely for convenience. Only values looked up on the server should determine the logic about how to process a transaction.\n * @property {string} threeDSecureInfo.acsTransactionId The transaction identifier from the issuing bank.\n * @property {string} threeDSecureInfo.cavv Cardholder authentication verification value or CAVV. The main encrypted message issuers and card networks use to verify authentication has occurred. Mastercard uses an AVV message and American Express uses an AEVV message, each of which should also be passed in the cavv parameter.\n * @property {string} threeDSecureInfo.dsTransactionId Transaction identifier resulting from 3D Secure 2 authentication.\n * @property {string} threeDSecureInfo.eciFlag The value of the electronic commerce indicator (ECI) flag, which indicates the outcome of the 3DS authentication. This will be a two-digit value.\n * @property {boolean} threeDSecureInfo.enrolled Indicates the status of 3D Secure authentication eligibility with the card issuer.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether liability shift is still possible on a retry.\n * @property {string} threeDSecureInfo.paresStatus Transaction status result identifier.\n * @property {string} threeDSecureInfo.status Indicates the outcome of the 3D Secure event.\n * @property {string} threeDSecureInfo.threeDSecureAuthenticationId ID of the 3D Secure authentication performed for this transaction. Do not provide this field as a transaction sale parameter if you are using the returned payment method nonce from the payload.\n * @property {string} threeDSecureInfo.threeDSecureServerTransactionId Transaction identifier provided by the issuing bank who recieved the 3D Secure event.\n * @property {string} threeDSecureInfo.threeDSecureVersion The version of 3D Secure authentication used for the transaction.\n * @property {string} threeDSecureInfo.xid Transaction identifier resulting from 3D Secure authentication. Uniquely identifies the transaction and sometimes required in the authorization message. This is a base64-encoded value. This field will no longer be used in 3D Secure 2 authentications for Visa and Mastercard, however it will be supported by American Express.\n * @property {string} threeDSecureInfo.lookup.transStatus Error code returned from the 3D Secure MPI provider.\n * @property {string} threeDSecureInfo.lookup.transStatusReason Description correlating to the transStatus error code.\n * @property {string} threeDSecureInfo.authentication.transStatus Error code returned from the 3D Secure MPI provider.\n * @property {string} threeDSecureInfo.authentication.transStatusReason Description correlating to the transStatus error code.\n * @property {object} rawCardinalSDKVerificationData The response back from the Cardinal SDK after verification has completed. See [Cardinal's Documentation](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects) for more information. If the customer was not required to do a 3D Secure challenge, this object will not be available.\n */\n\n /**\n * @typedef {string} ThreeDSecure~prepareLookupPayload The client data to pass on when doing a server side lookup call.\n */\n\n /**\n * @typedef {object} ThreeDSecure~verificationData\n * @property {boolean} requiresUserAuthentication When `true`, the user will be presented with a 3D Secure challenge when calling `next` in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete` event}.\n * @property {object} threeDSecureInfo Contains liability shift details.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether the card was eligible for 3D Secure.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {object} paymentMethod A {@link ThreeDSecure~verifyPayload|verifyPayload} object.\n * @property {object} lookup Details about the 3D Secure lookup.\n * @property {string} lookup.threeDSecureVersion The version of 3D Secure that will be used for the 3D Secure challenge.\n */\n\n /**\n * @typedef {object} ThreeDSecure~billingAddress\n * @property {string} [givenName] The first name associated with the billing address. (maximum length 50, ASCII characters)\n * @property {string} [surname] The last name associated with the billing address. (maximum length 50, ASCII characters)\n * @property {string} [phoneNumber] The phone number associated with the billing address. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [streetAddress] Line 1 of the billing address (eg. number, street, etc). (maximum length 50)\n * @property {string} [extendedAddress] Line 2 of the billing address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [line3] Line 3 of the billing address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [locality] The locality (city) name associated with the billing address.\n * @property {string} [region] This field expects an ISO3166-2 subdivision code. The subdivision code is what follows the hyphen separator in the full ISO 3166-2 code. For example, the state of Ohio in the United States we expect \"OH\" as opposed to the full ISO 3166-2 code \"US-OH\".\n * @property {string} [postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [countryCodeAlpha2] The 2 character country code.\n */\n\n /**\n * @typedef {object} ThreeDSecure~additionalInformation\n * @property {string} [workPhoneNumber] The work phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @property {string} [shippingGivenName] The first name associated with the shipping address. (maximum length 50, ASCII characters)\n * @property {string} [shippingSurname] The last name associated with the shipping address. (maximum length 50, ASCII characters)\n * @property {object} [shippingAddress]\n * @property {string} [shippingAddress.streetAddress] Line 1 of the shipping address (eg. number, street, etc). (maximum length 50)\n * @property {string} [shippingAddress.extendedAddress] Line 2 of the shipping address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [shippingAddress.line3] Line 3 of the shipping address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [shippingAddress.locality] The locality (city) name associated with the shipping address. (maximum length 50)\n * @property {string} [shippingAddress.region] This field expects an ISO3166-2 subdivision code. The subdivision code is what follows the hyphen separator in the full ISO 3166-2 code. For example, the state of Ohio in the United States we expect \"OH\" as opposed to the full ISO 3166-2 code \"US-OH\".\n * @property {string} [shippingAddress.postalCode] The zip code or equivalent for countries that have them. (maximum length 10)\n * @property {string} [shippingAddress.countryCodeAlpha2] The 2 character country code. (maximum length 2)\n * @property {string} [shippingPhone] The phone number associated with the shipping address. Only numbers; remove dashes, parenthesis and other characters. (maximum length 20)\n * @property {string} [shippingMethod] The 2-digit string indicating the name of the shipping method chosen for the transaction. (maximum length 50) Possible values:\n * - `01` Same Day\n * - `02` Overnight / Expedited\n * - `03` Priority (2-3 Days)\n * - `04` Ground\n * - `05` Electronic Delivery\n * - `06` Ship to Store\n * @property {string} [shippingMethodIndicator] The 2-digit string indicating the shipping method chosen for the transaction Possible values.\n * - `01` Ship to cardholder billing address\n * - `02` Ship to another verified address on file with merchant\n * - `03` Ship to address that is different from billing address\n * - `04` Ship to store (store address should be populated on request)\n * - `05` Digital goods\n * - `06` Travel and event tickets, not shipped\n * - `07` Other\n * @property {string} [productCode] The 3-letter string representing the merchant product code. Possible values:\n * - `AIR` Airline\n * - `GEN` General Retail\n * - `DIG` Digital Goods\n * - `SVC` Services\n * - `RES` Restaurant\n * - `TRA` Travel\n * - `DSP` Cash Dispensing\n * - `REN` Car Rental\n * - `GAS` Fuel\n * - `LUX` Luxury Retail\n * - `ACC` Accommodation Retail\n * - `TBD` Other\n * @property {string} [deliveryTimeframe] The 2-digit number indicating the delivery time frame. Possible values:\n * - `01` Electronic delivery\n * - `02` Same day shipping\n * - `03` Overnight shipping\n * - `04` Two or more day shipping\n * @property {string} [deliveryEmail] For electronic delivery, email address to which the merchandise was delivered. (maximum length 254)\n * @property {string} [reorderindicator] The 2-digit number indicating whether the cardholder is reordering previously purchased merchandise. possible values:\n * - `01` First time ordered\n * - `02` Reordered\n * @property {string} [preorderIndicator] The 2-digit number indicating whether cardholder is placing an order with a future availability or release date. possible values:\n * - `01` Merchandise available\n * - `02` Future availability\n * @property {string} [preorderDate] The 8-digit number (format: YYYYMMDD) indicating expected date that a pre-ordered purchase will be available.\n * @property {string} [giftCardAmount] The purchase amount total for prepaid gift cards in major units. (maximum length 15)\n * @property {string} [giftCardCurrencyCode] ISO 4217 currency code for the gift card purchased. (maximum length 3)\n * @property {string} [giftCardCount] Total count of individual prepaid gift cards purchased. (maximum length 2)\n * @property {string} [accountAgeIndicator] The 2-digit value representing the length of time cardholder has had account. Possible values:\n * - `01` No Account\n * - `02` Created during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountCreateDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder opened the account.\n * @property {string} [accountChangeIndicator] The 2-digit value representing the length of time since the last change to the cardholder account. This includes shipping address, new payment account or new user added. Possible values:\n * - `01` Changed during transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [accountChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder's account was last changed. This includes changes to the billing or shipping address, new payment accounts or new users added.\n * @property {string} [accountPwdChangeIndicator] The 2-digit value representing the length of time since the cardholder changed or reset the password on the account. Possible values:\n * - `01` No change\n * - `02` Changed during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountPwdChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder last changed or reset password on account.\n * @property {string} [shippingAddressUsageIndicator] The 2-digit value indicating when the shipping address used for transaction was first used. Possible values:\n * - `01` This transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [shippingAddressUsageDate] The 8-digit number (format: YYYYMMDD) indicating the date when the shipping address used for this transaction was first used.\n * @property {string} [transactionCountDay] Number of transactions (successful or abandoned) for this cardholder account within the last 24 hours. (maximum length 3)\n * @property {string} [transactionCountYear] Number of transactions (successful or abandoned) for this cardholder account within the last year. (maximum length 3)\n * @property {string} [addCardAttempts] Number of add card attempts in the last 24 hours. (maximum length 3)\n * @property {string} [accountPurchases] Number of purchases with this cardholder account during the previous six months.\n * @property {string} [fraudActivity] The 2-digit value indicating whether the merchant experienced suspicious activity (including previous fraud) on the account. Possible values:\n * - `01` No suspicious activity\n * - `02` Suspicious activity observed\n * @property {string} [shippingNameIndicator] The 2-digit value indicating if the cardholder name on the account is identical to the shipping name used for the transaction. Possible values:\n * - `01` Account and shipping name identical\n * - `02` Account and shipping name differ\n * @property {string} [paymentAccountIndicator] The 2-digit value indicating the length of time that the payment account was enrolled in the merchant account. Possible values:\n * - `01` No account (guest checkout)\n * - `02` During the transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [paymentAccountAge] The 8-digit number (format: YYYYMMDD) indicating the date the payment account was added to the cardholder account.\n * @property {string} [acsWindowSize] The 2-digit number to set the challenge window size to display to the end cardholder. The ACS will reply with content that is formatted appropriately to this window size to allow for the best user experience. The sizes are width x height in pixels of the window displayed in the cardholder browser window. Possible values:\n * - `01` 250x400\n * - `02` 390x400\n * - `03` 500x600\n * - `04` 600x400\n * - `05` Full page\n * @property {string} [sdkMaxTimeout] The 2-digit number of minutes (minimum 05) to set the maximum amount of time for all 3DS 2.0 messages to be communicated between all components.\n * @property {string} [addressMatch] The 1-character value (Y/N) indicating whether cardholder billing and shipping addresses match.\n * @property {string} [accountId] Additional cardholder account information. (maximum length 64)\n * @property {string} [ipAddress] The IP address of the consumer. IPv4 and IPv6 are supported.\n * - only one IP address supported\n * - only numbers, letters, period '.' chars, or colons ':' are acceptable\n * @property {string} [orderDescription] Brief description of items purchased. (maximum length 256)\n * @property {string} [taxAmount] Unformatted tax amount without any decimalization (ie. $123.67 = 12367). (maximum length 20)\n * @property {string} [userAgent] The exact content of the HTTP user agent header. (maximum length 500)\n * @property {string} [authenticationIndicator] The 2-digit number indicating the type of authentication request. Possible values:\n * - `01` Payment\n * - `02` Recurring transaction\n * - `03` Installment\n * - `04` Add card\n * - `05` Maintain card\n * - `06` Cardholder verification as part of EMV token ID&V\n * @property {string} [installment] An integer value greater than 1 indicating the maximum number of permitted authorizations for installment payments. (maximum length 3)\n * @property {string} [purchaseDate] The 14-digit number (format: YYYYMMDDHHMMSS) indicating the date in UTC of original purchase.\n * @property {string} [recurringEnd] The 8-digit number (format: YYYYMMDD) indicating the date after which no further recurring authorizations should be performed.\n * @property {string} [recurringFrequency] Integer value indicating the minimum number of days between recurring authorizations. A frequency of monthly is indicated by the value 28. Multiple of 28 days will be used to indicate months (ex. 6 months = 168). (maximum length 3)\n */\n\n /**\n * @name ThreeDSecure#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. The following events are available:\n * * {@link ThreeDSecure#event:lookup-complete|lookup-complete}\n * * {@link ThreeDSecure#event:customer-canceled|customer-canceled}\n * * {@link ThreeDSecure#event:authentication-iframe-available|authentication-iframe-available}\n * * {@link ThreeDSecure#event:authentication-modal-render|authentication-modal-render}\n * * {@link ThreeDSecure#event:authentication-modal-close|authentication-modal-close}\n * @example\n * Listening to a 3D Secure event\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * console.log('data from the lookup', data);\n * next();\n * });\n * threeDSecureInstance.on('customer-canceled', function () {\n * console.log('log that the customer canceled');\n * });\n * });\n * @returns {void}\n */\n\n /**\n * @name ThreeDSecure#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n * Subscribing and then unsubscribing from a 3D Secure eld event\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * var lookupCallback = function (data, next) {\n * console.log(data);\n * next();\n * };\n * var cancelCallback = function () {\n * // log the cancelation\n * // or update UI\n * };\n *\n * threeDSecureInstance.on('lookup-complete', lookupCallback);\n * threeDSecureInstance.on('customer-canceled', cancelCallback);\n *\n * // later on\n * threeDSecureInstance.off('lookup-complete', lookupCallback);\n * threeDSecureInstance.off('customer-canceled', cancelCallback);\n * });\n * @returns {void}\n */\n\n /**\n * This event is emitted when the `2-inline-iframe` version is specified when creating the 3D Secure instance and the authentication iframe becomes available.\n * @event ThreeDSecure#authentication-iframe-available\n * @example\n * Listening for the authentication iframe to be available\n * threeDSecureInstance.on('authentication-iframe-available', function (event, next) {\n * document.body.appendChild(event.element); // add iframe element to page\n *\n * next(); // let the SDK know the iframe is ready\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the initial lookup request completes. If this is not used, a `onLookupComplete` callback must be passed into the `verifyCard` method.\n * @event ThreeDSecure#lookup-complete\n * @example\n * Listening for when the lookup request is complete\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * // inspect the data\n *\n * // call next when ready to proceed with the challenge\n * next();\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the customer cancels the 3D Secure challenge.\n * @event ThreeDSecure#customer-canceled\n * @example\n * Listening for when the customer cancels the 3D Secure challenge\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('customer-canceled', function () {\n * // the customer canceled the 3D Secure challenge\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal closes, either because the authentication was completed or because the customer canceled the process.\n * @event ThreeDSecure#authentication-modal-close\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-close', function () {\n * // the modal was closed\n * });\n * });\n */\n\n /**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal is rendered.\n * @event ThreeDSecure#authentication-modal-render\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-render', function () {\n * // the modal was rendered, presenting the authentication form to the customer\n * });\n * });\n */\n\n /**\n * @class\n * @param {object} options 3D Secure {@link module:braintree-web/three-d-secure.create create} options\n * @description Do not use this constructor directly. Use {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create} instead.\n * @classdesc This class represents a ThreeDSecure component produced by {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create}. Instances of this class have a method for launching a 3D Secure authentication flow.\n *\n * If you use the Braintree SDK from within an iframe, you must not use the `sandbox` attribute on your iframe or the 3D Secure modal will not function correctly.\n *\n * **Note**: 3D Secure 2.0 is documented below and will become the default integration method in a future version of Braintree-web. Until then, version 1.0 will continue to be supported. To view 3D Secure 1.0 documentation, look at Braintree-web documentation from version [3.40.0](https://braintree.github.io/braintree-web/3.40.0/ThreeDSecure.html) and earlier, or upgrade your integration by referring to the [3D Secure 2.0 adoption guide](https://developer.paypal.com/braintree/docs/guides/3d-secure/migration/javascript/v3).\n */\n function ThreeDSecure(options) {\n var self = this;\n var Framework = FRAMEWORKS[options.framework];\n EventEmitter.call(this);\n this._framework = new Framework(options);\n this._framework.setUpEventListeners(function () {\n self._emit.apply(self, arguments);\n });\n }\n EventEmitter.createChild(ThreeDSecure);\n // NEXT_MAJOR_VERSION remove exemptionRequested entirely in favor of `requestedExemptionType`\n /**\n * Launch the 3D Secure login flow, returning a nonce payload.\n *\n * @public\n * @param {object} options Options for card verification.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} options.bin The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`.\n * @param {string} options.amount The amount of the transaction in the current merchant account's currency. This must be expressed in numbers with an optional decimal (using `.`) and precision up to the hundredths place. For example, if you're processing a transaction for 1.234,56 € then `amount` should be `1234.56`.\n * @param {string} [options.accountType] The account type for the card (if known). Accepted values: `credit` or `debit`.\n * @param {boolean} [options.cardAddChallengeRequested] If set to `true`, a card-add challenge will be requested from the issuer. If set to `false`, a card-add challenge will not be requested. If the param is missing, a card-add challenge will only be requested for $0 amount. An authentication created using this flag should only be used for vaulting operations (creation of customers' credit cards or payment methods) and not for creating transactions.\n * @param {boolean} [options.cardAdd] *Deprecated:* Use `cardAddChallengeRequested` instead.\n * @param {boolean} [options.challengeRequested] If set to true, an authentication challenge will be forced if possible.\n * @param {boolean} [options.dataOnlyRequested] Indicates whether to use the data only flow. In this flow, frictionless 3DS is ensured for Mastercard cardholders as the card scheme provides a risk score for the issuer to determine whether to approve. If data only is not supported by the processor, a validation error will be raised. Non-Mastercard cardholders will fallback to a normal 3DS flow.\n * @param {boolean} [options.exemptionRequested] *Deprecated:* Use `requestedExemptionType` instead.\n * @param {boolean} [options.requestVisaDAF] Request to use VISA Digital Authentication Framework. If set to true, a Visa DAF authenticated payment credential will be created and/or used for authentication if the merchant is eligible.\n * @param {string} [options.merchantName] Allows to override the merchant name that is shown in the challenge.\n * @param {string} [options.requestedExemptionType] If an exemption is requested and the exemption's conditions are satisfied, then it will be applied. The following supported exemptions are defined as per PSD2 regulation: `low_value`, `transaction_risk_analysis`\n * @param {object} [options.customFields] Object where each key is the name of a custom field which has been configured in the Control Panel. In the Control Panel you can configure 3D Secure Rules which trigger on certain values.\n * @param {function} [options.onLookupComplete] *Deprecated:* Use {@link ThreeDSecure#event:lookup-complete|`threeDSecureInstance.on('lookup-complete')`} instead. Function to execute when lookup completes. The first argument, `data`, is a {@link ThreeDSecure~verificationData|verificationData} object, and the second argument, `next`, is a callback. `next` must be called to continue.\n * @param {string} [options.email] The email used for verification. (maximum length 255)\n * @param {string} [options.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @param {object} [options.billingAddress] An {@link ThreeDSecure~billingAddress|billingAddress} object for verification.\n * @param {object} [options.additionalInformation] An {@link ThreeDSecure~additionalInformation|additionalInformation} object for verification.\n * @param {object} [options.collectDeviceData] If set to `true`, device data such as browser screen dimensions, language and time zone is submitted with lookup data.\n * @param {object} [options.customer] **Deprecated** Customer information for use in 3DS 1.0 verifications. Can contain any subset of a {@link ThreeDSecure~verifyCardCustomerObject|verifyCardCustomerObject}. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.addFrame **Deprecated** This {@link ThreeDSecure~addFrameCallback|addFrameCallback} will be called when the bank frame needs to be added to your page. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.removeFrame **Deprecated** For use in 3DS 1.0 Flows. This {@link ThreeDSecure~removeFrameCallback|removeFrameCallback} will be called when the bank frame needs to be removed from your page. Only to be used in 3DS 1.0 integrations.\n * @param {callback} [callback] The second argument, data, is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~verifyPayload|verifyPayload}.\n \n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * Verifying a payment method nonce with 3DS 2.0\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n * @example\n * Verifying a payment method nonce with 3DS 2.0 with onLookupComplete callback\n * var my3DSContainer;\n *\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * },\n * onLookupComplete: function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n * @example\n * Handling 3DS lookup errors\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com',\n * billingAddress: billingAddressFromCustomer,\n * additionalInformation: additionalInfoFromCustomer\n * }, function (err, payload) {\n * if (err) {\n * if (err.code.indexOf('THREEDS_LOOKUP') === 0) {\n * // an error occurred during the initial lookup request\n *\n * if (err.code === 'THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR') {\n * // either the passed payment method nonce does not exist\n * // or it was already consumed before the lookup call was made\n * } else if (err.code.indexOf('THREEDS_LOOKUP_VALIDATION') === 0) {\n * // a validation error occurred\n * // likely some non-ascii characters were included in the billing\n * // address given name or surname fields, or the cardholdername field\n *\n * // Instruct your user to check their data and try again\n * } else {\n * // an unknown lookup error occurred\n * }\n * } else {\n * // some other kind of error\n * }\n * return;\n * }\n *\n * // handle success\n * });\n */\n ThreeDSecure.prototype.verifyCard = function (options) {\n var privateOptions;\n if (this.hasListener(\"lookup-complete\")) {\n privateOptions = {\n ignoreOnLookupCompleteRequirement: true\n };\n }\n return this._framework.verifyCard(options, privateOptions);\n };\n\n /* eslint-disable-next-line valid-jsdoc */\n /**\n * Launch the iframe challenge using a 3D Secure lookup response from a server side lookup.\n *\n * @public\n * @param {(object|string)} lookupResponse The lookup response from the server side call to lookup the 3D Secure information. The raw string or a parsed object can be passed.\n * @returns {Promise} Returns a promise.\n * @example\n * var my3DSContainer;\n *\n * threeDSecure.initializeChallengeWithLookupResponse(lookupResponseFromServer).then(function (payload) {\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n */\n ThreeDSecure.prototype.initializeChallengeWithLookupResponse = function (lookupResponse) {\n if (typeof lookupResponse === \"string\") {\n lookupResponse = JSON.parse(lookupResponse);\n }\n return this._framework.initializeChallengeWithLookupResponse(lookupResponse);\n };\n\n /**\n * Gather the data needed for a 3D Secure lookup call.\n *\n * @public\n * @param {object} options Options for 3D Secure lookup.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} options.bin The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`.\n * @param {callback} [callback] The second argument, data, is a {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}.\n \n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * Preparing data for a 3D Secure lookup\n * threeDSecure.prepareLookup({\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * // send payload to server to do server side lookup\n * });\n */\n ThreeDSecure.prototype.prepareLookup = function (options) {\n return this._framework.prepareLookup(options).then(function (data) {\n return JSON.stringify(data);\n });\n };\n\n /**\n * Cancel the 3DS flow and return the verification payload if available. If using 3D Secure version 2, this will not close the UI of the authentication modal. It is recommended that this method only be used in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete`} event or the `onLookupComplete` callback.\n * @public\n * @param {callback} [callback] The second argument is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If there is no verifyPayload (the initial lookup did not complete), an error will be returned. If no callback is passed, `cancelVerifyCard` will return a promise.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example Cancel the verification in `lookup-complete` event\n * // set up listener after instantiation\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * });\n *\n * // after tokenizing a credit card\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload\n * // other fields such as billing address\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example Cancel the verification in onLookupComplete callback\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * // other fields such as billing address\n * onLookupComplete: function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * }\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example Cancel the verification in 3D Secure version 1\n * // unlike with v2, this will not cause `verifyCard` to error, it will simply\n * // never call the callback\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n */\n ThreeDSecure.prototype.cancelVerifyCard = function () {\n return this._framework.cancelVerifyCard();\n };\n\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/three-d-secure.create|create}, with the exception that the Cardinal SDK, on window.Cardinal, will remain.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is passed, `teardown` will return a promise.\n * @example\n * threeDSecure.teardown();\n * @example With callback\n * threeDSecure.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n ThreeDSecure.prototype.teardown = function () {\n var methodNames = methods(ThreeDSecure.prototype).concat(methods(EventEmitter.prototype));\n convertMethodsToError(this, methodNames);\n return this._framework.teardown();\n };\n module.exports = wrapPromise.wrapPrototype(ThreeDSecure);\n }, {\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/methods\": 155,\n \"./frameworks\": 193,\n \"@braintree/event-emitter\": 33,\n \"@braintree/wrap-promise\": 43\n }],\n 198: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /** @module braintree-web/three-d-secure */\n var ThreeDSecure = _dereq_(\"./external/three-d-secure\");\n var isHTTPS = _dereq_(\"../lib/is-https\").isHTTPS;\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var analytics = _dereq_(\"../lib/analytics\");\n var errors = _dereq_(\"./shared/errors\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {object} [options.cardinalSDKConfig] A config for the underlying Cardinal SDK.\n * @param {object} [options.cardinalSDKConfig.logging] The logging configuration for the Cardinal SDK. See [Cardinal's documentation for the logging object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Logging) for more information.\n * @param {number} [options.cardinalSDKConfig.timeout] The time in milliseconds to wait before a request to Cardinal's API times out. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {number} [options.cardinalSDKConfig.maxRequestRetries] How many times a request should be re-attempted to Cardinal's API before giving up as a failure. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {object} [options.cardinalSDKConfig.payment] An object to describe how you want the user interactions to behave. Only a subset of the [Cardinal SDK payment configuration object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Payment) are supported: `displayLoading` and `displayExitButton`.\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {(number|string)} [options.version=1] The version of 3D Secure to use. Possible options:\n * * 1 - The legacy 3D Secure v1.0 integration.\n * * 2 - A 3D Secure v2.0 integration that uses a modal to host the 3D Secure iframe.\n * * 2-bootstrap3-modal - A 3D Secure v2.0 integration that uses a modal styled with Bootstrap 3 styles to host the 3D Secure iframe. Requires having the Bootstrap 3 script files and stylesheets on your page.\n * * 2-inline-iframe - A 3D Secure v2.0 integration that provides the authentication iframe directly to the merchant.\n * @param {callback} [callback] The second argument, `data`, is the {@link ThreeDSecure} instance. If no callback is provided, it returns a promise that resolves the {@link ThreeDSecure} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n @example\n * Creating a v2 3D Secure component using 2 version (Cardinal modal)\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n * Creating a v2 3D Secure component using 2-bootstrap3-modal version\n * // must have the boostrap js, css and jquery files on your page\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-bootstrap3-modal'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * // challenge will be presented in a bootstrap 3 modal\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n * Creating a v2 3D Secure component using 2-inline-iframe version\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-inline-iframe'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n * // set up iframe listener\n * threeDSecure.on('authentication-iframe-available', function (event, next) {\n * var element = event.element; // an html element that contains the iframe\n *\n * document.body.appendChild(element); // put it on your page\n *\n * next(); // let the sdk know the element has been added to the page\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n */\n function create(options) {\n var name = \"3D Secure\";\n var framework = getFramework(options);\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var assetsUrl = createAssetsUrl.create(options.authorization);\n var createPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: assetsUrl,\n name: name\n }).then(function (client) {\n var error, isProduction;\n var config = client.getConfiguration();\n var gwConfig = config.gatewayConfiguration;\n options.client = client;\n if (!gwConfig.threeDSecureEnabled) {\n error = errors.THREEDS_NOT_ENABLED;\n }\n if (config.authorizationType === \"TOKENIZATION_KEY\") {\n error = errors.THREEDS_CAN_NOT_USE_TOKENIZATION_KEY;\n }\n isProduction = gwConfig.environment === \"production\";\n if (isProduction && !isHTTPS()) {\n error = errors.THREEDS_HTTPS_REQUIRED;\n }\n if (framework !== \"legacy\" && !(gwConfig.threeDSecure && gwConfig.threeDSecure.cardinalAuthenticationJWT)) {\n analytics.sendEvent(options.client, \"three-d-secure.initialization.failed.missing-cardinalAuthenticationJWT\");\n error = errors.THREEDS_NOT_ENABLED_FOR_V2;\n }\n if (error) {\n return Promise.reject(new BraintreeError(error));\n }\n analytics.sendEvent(options.client, \"three-d-secure.initialized\");\n return client;\n });\n var instance = new ThreeDSecure({\n client: options.client,\n assetsUrl: assetsUrl,\n createPromise: createPromise,\n loggingEnabled: options.loggingEnabled,\n cardinalSDKConfig: options.cardinalSDKConfig,\n framework: framework\n });\n if (options.client) {\n return createPromise.then(function () {\n return instance;\n });\n }\n return instance;\n });\n }\n function getFramework(options) {\n var version = String(options.version || \"\");\n if (!version || version === \"1\") {\n throw new BraintreeError({\n code: errors.THREEDS_UNSUPPORTED_VERSION.code,\n type: errors.THREEDS_UNSUPPORTED_VERSION.type,\n message: errors.THREEDS_UNSUPPORTED_VERSION.message\n });\n }\n switch (version) {\n case \"2\":\n case \"2-cardinal-modal\":\n return \"cardinal-modal\";\n case \"2-bootstrap3-modal\":\n return \"bootstrap3-modal\";\n case \"2-inline-iframe\":\n return \"inline-iframe\";\n default:\n throw new BraintreeError({\n code: errors.THREEDS_UNRECOGNIZED_VERSION.code,\n type: errors.THREEDS_UNRECOGNIZED_VERSION.type,\n message: \"Version `\" + options.version + \"` is not a recognized version. You may need to update the version of your Braintree SDK to support this version.\"\n });\n }\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"../lib/is-https\": 152,\n \"./external/three-d-secure\": 197,\n \"./shared/errors\": 200,\n \"@braintree/wrap-promise\": 43\n }],\n 199: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n LANDING_FRAME_NAME: \"braintreethreedsecurelanding\",\n CARDINAL_SCRIPT_SOURCE: {\n production: \"https://songbird.cardinalcommerce.com/edge/v1/songbird.js\",\n sandbox: \"https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js\"\n }\n };\n }, {}],\n 200: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.3D Secure - Creation Error Codes\n * @description Errors that occur when [creating the 3D Secure component](./module-braintree-web_three-d-secure.html#.create).\n * @property {MERCHANT} THREEDS_NOT_ENABLED Occurs when 3D Secure is not enabled in the Braintree control panel.\n * @property {MERCHANT} THREEDS_CAN_NOT_USE_TOKENIZATION_KEY Occurs when 3D Secure component is created without a Client Token.\n * @property {MERCHANT} THREEDS_HTTPS_REQUIRED Occurs when 3D Secure component is created in production over HTTPS.\n * @property {MERCHANT} THREEDS_NOT_ENABLED_FOR_V2 Occurs when 3D Secure component is created with version 2 parameter, but merchant is not enabled to use version 2.\n * @property {MERCHANT} THREEDS_UNRECOGNIZED_VERSION Occurs when unrecognized version enum is passed into the create call.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_FAILED Occurs when Cardinal's Songbird.js library fails to setup for an unknown reason.\n * @property {NETWORK} THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED Occurs when using version 2 and Cardinal's Songbird.js script could not be loaded.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT Occurs when Cardinal's Songbird.js library takes longer than 60 seconds to set up.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT Occurs when Cardinal sends a response indicating a timeout on /Validate, /Confirm, or /Continue.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_CONFIG Occurs when there is no JWT in the request. Also when there's some other malformed aspect of config.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_JWT Occurs when a malformed config causes a either a missing response JWT or a malformed Cardinal response.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_ERROR Occurs when a \"general error\" or a Cardinal hosted fields error happens. Description contains more details.\n * @property {CUSTOMER} THREEDS_CARDINAL_SDK_CANCELED Occurs when customer cancels the transaction mid-flow, usually with alt-pays that have their own cancel buttons.\n * @property {MERCHANT} THREEDS_UNSUPPORTED_VERSION Occurs when 3D Secure component is created with version 1 (or default version) parameter.\n */\n\n /**\n * @name BraintreeError.3D Secure - verifyCard Error Codes\n * @description Errors that occur when using the [`verifyCard` method](./ThreeDSecure.html#verifyCard).\n * @property {MERCHANT} THREEDS_AUTHENTICATION_IN_PROGRESS Occurs when another verification is already in progress.\n * @property {MERCHANT} THREEDS_MISSING_VERIFY_CARD_OPTION Occurs when a required option is missing.\n * @property {UNKNOWN} THREEDS_JWT_AUTHENTICATION_FAILED Occurs when something went wrong authenticating the JWT from the Cardinal SDK.\n * @property {MERCHANT} THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR Occurs when the supplied payment method nonce does not exist or the payment method nonce has already been consumed.\n * @property {CUSTOMER} THREEDS_LOOKUP_VALIDATION_ERROR Occurs when a validation error occurs during the 3D Secure lookup.\n * @property {UNKNOWN} THREEDS_LOOKUP_ERROR An unknown error occurred while attempting the 3D Secure lookup.\n * @property {MERCHANT} THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT Occurs when the 3D Secure flow is canceled by the merchant using `cancelVerifyCard` (3D Secure v2 flows only).\n * @property {UNKNOWN} THREEDS_INLINE_IFRAME_DETAILS_INCORRECT An unknown error occurred while attempting to use the inline iframe framework.\n * @property {MERCHANT} THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID Occurs when unrecognized exemption enum value is passed into verifyCard.\n */\n\n /**\n * @name BraintreeError.3D Secure - cancelVerifyCard Error Codes\n * @description Errors that occur when using the [`cancelVerifyCard` method](./ThreeDSecure.html#cancelVerifyCard).\n * @property {MERCHANT} THREEDS_NO_VERIFICATION_PAYLOAD Occurs when the 3D Secure flow is canceled, but there is no 3D Secure information available.\n */\n\n /**\n * @name BraintreeError.3D Secure - Internal Error Codes\n * @ignore\n * @description Errors that occur internally\n * @property {INTERNAL} THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN Occurs when iframe is initialized on a non-verified domain.\n * @property {INTERNAL} THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED Occurs when a 3D Secure framework method is not implemented.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n THREEDS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NOT_ENABLED\",\n message: \"3D Secure is not enabled for this merchant.\"\n },\n THREEDS_CAN_NOT_USE_TOKENIZATION_KEY: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CAN_NOT_USE_TOKENIZATION_KEY\",\n message: \"3D Secure can not use a tokenization key for authorization.\"\n },\n THREEDS_HTTPS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_HTTPS_REQUIRED\",\n message: \"3D Secure requires HTTPS.\"\n },\n THREEDS_NOT_ENABLED_FOR_V2: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NOT_ENABLED_FOR_V2\",\n message: \"3D Secure version 2 is not enabled for this merchant. Contact Braintree Support for assistance at https://help.braintreepayments.com/\"\n },\n THREEDS_UNRECOGNIZED_VERSION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_UNRECOGNIZED_VERSION\"\n },\n THREEDS_CARDINAL_SDK_SETUP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_SETUP_FAILED\",\n message: \"Something went wrong setting up Cardinal's Songbird.js library.\"\n },\n THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED\",\n message: \"Cardinal's Songbird.js library could not be loaded.\"\n },\n THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT\",\n message: \"Cardinal's Songbird.js took too long to setup.\"\n },\n THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT\",\n message: \"Cardinal's API took too long to respond.\"\n },\n THREEDS_CARDINAL_SDK_BAD_CONFIG: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CARDINAL_SDK_BAD_CONFIG\",\n message: \"JWT or other required field missing. Please check your setup configuration.\"\n },\n THREEDS_CARDINAL_SDK_BAD_JWT: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CARDINAL_SDK_BAD_JWT\",\n message: \"Cardinal JWT missing or malformed. Please check your setup configuration.\"\n },\n THREEDS_CARDINAL_SDK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_ERROR\",\n message: \"A general error has occurred with Cardinal. See description for more information.\"\n },\n THREEDS_CARDINAL_SDK_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"THREEDS_CARDINAL_SDK_CANCELED\",\n message: \"Canceled by user.\"\n },\n THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT\",\n message: \"3D Secure verfication canceled by merchant.\"\n },\n THREEDS_AUTHENTICATION_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_AUTHENTICATION_IN_PROGRESS\",\n message: \"Cannot call verifyCard while existing authentication is in progress.\"\n },\n THREEDS_MISSING_VERIFY_CARD_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_MISSING_VERIFY_CARD_OPTION\"\n },\n THREEDS_JWT_AUTHENTICATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_JWT_AUTHENTICATION_FAILED\",\n message: \"Something went wrong authenticating the JWT from Cardinal\"\n },\n THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR\",\n message: \"Either the payment method nonce passed to `verifyCard` does not exist, or it was already consumed\"\n },\n THREEDS_LOOKUP_VALIDATION_ERROR: {\n type: BraintreeError.types.CUSTOMER,\n code: \"THREEDS_LOOKUP_VALIDATION_ERROR\",\n message: \"The data passed in `verifyCard` did not pass validation checks. See details for more info\"\n },\n THREEDS_LOOKUP_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_LOOKUP_ERROR\",\n message: \"Something went wrong during the 3D Secure lookup\"\n },\n THREEDS_INLINE_IFRAME_DETAILS_INCORRECT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_INLINE_IFRAME_DETAILS_INCORRECT\",\n message: \"Something went wrong when attempting to add the authentication iframe to the page.\"\n },\n THREEDS_NO_VERIFICATION_PAYLOAD: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NO_VERIFICATION_PAYLOAD\",\n message: \"No verification payload available.\"\n },\n THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN: {\n type: BraintreeError.types.INTERNAL,\n code: \"THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN\",\n message: \"Term Url must be on a Braintree domain.\"\n },\n THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED: {\n type: BraintreeError.types.INTERNAL,\n code: \"THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED\",\n message: \"Method not implemented for this framework.\"\n },\n THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID\",\n message: \"Requested Exemption Type is invalid.\"\n },\n THREEDS_UNSUPPORTED_VERSION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_UNSUPPORTED_VERSION\",\n message: \"3D Secure `1` is deprecated and no longer supported. See available versions at https://braintree.github.io/braintree-web/current/module-braintree-web_three-d-secure.html#.create\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 201: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var enumerate = _dereq_(\"../../lib/enumerate\");\n module.exports = enumerate([\"AUTHENTICATION_COMPLETE\"], \"threedsecure:\");\n }, {\n \"../../lib/enumerate\": 134\n }],\n 202: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/unionpay\n * @description This module allows you to accept UnionPay payments. *It is currently in beta and is subject to change.*\n */\n var UnionPay = _dereq_(\"./shared/unionpay\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var analytics = _dereq_(\"../lib/analytics\");\n var errors = _dereq_(\"./shared/errors\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link UnionPay} instance. If no callback is provided, `create` returns a promise that resolves with the {@link UnionPay} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) {\n * if (createErr) {\n * console.error(createErr);\n * return;\n * }\n * // ...\n * });\n */\n function create(options) {\n var name = \"UnionPay\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var config = client.getConfiguration();\n options.client = client;\n if (!config.gatewayConfiguration.unionPay || config.gatewayConfiguration.unionPay.enabled !== true) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_NOT_ENABLED));\n }\n analytics.sendEvent(options.client, \"unionpay.initialized\");\n return new UnionPay(options);\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./shared/errors\": 204,\n \"./shared/unionpay\": 205,\n \"@braintree/wrap-promise\": 43\n }],\n 203: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var enumerate = _dereq_(\"../../lib/enumerate\");\n module.exports = {\n events: enumerate([\"HOSTED_FIELDS_FETCH_CAPABILITIES\", \"HOSTED_FIELDS_ENROLL\", \"HOSTED_FIELDS_TOKENIZE\"], \"union-pay:\"),\n HOSTED_FIELDS_FRAME_NAME: \"braintreeunionpayhostedfields\"\n };\n }, {\n \"../../lib/enumerate\": 134\n }],\n 204: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Union Pay - Creation Error Codes\n * @description Errors that occur when [creating the Union Pay component](./module-braintree-web_union-pay.html#.create).\n * @property {MERCHANT} UNIONPAY_NOT_ENABLED Occurs when Union Pay is not enabled on the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Union Pay - Shared Error Codes\n * @description Errors that occur when starting the Union Pay Flow\n * @property {MERCHANT} UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES Occurs when a method is used with both card details and a Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID Occurs when Hosted Fields instance used is not a valid Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when neither card details or Hosted Fields are used.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when Hosted Fields cannot be found on the page.\n */\n\n /**\n * @name BraintreeError.Union Pay - fetchCapabilities Error Codes\n * @description Errors that occur when using the [`fetchCapabilities` method](./UnionPay.html#fetchCapabilities).\n * @property {NETWORK} UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR Occurs when there is an error looking up the Union Pay capabilities.\n */\n\n /**\n * @name BraintreeError.Union Pay - enroll Error Codes\n * @description Errors that occur when using the [`enroll` method](./UnionPay.html#enroll).\n * @property {MERCHANT} UNIONPAY_MISSING_MOBILE_PHONE_DATA Occurs when no mobile phone data is provided.\n * @property {MERCHANT} UNIONPAY_EXPIRATION_DATE_INCOMPLETE Occurs when expiration date is incomplete.\n * @property {CUSTOMER} UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID Occurs when customer enrollment input is invalid.\n * @property {NETWORK} UNIONPAY_ENROLLMENT_NETWORK_ERROR Occurs when there is an error during enrollment.\n */\n\n /**\n * @name BraintreeError.Union Pay - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UnionPay.html#tokenize).\n * @property {CUSTOMER} UNIONPAY_FAILED_TOKENIZATION Occurs when data cannot be tokenized.\n * @property {NETWORK} UNIONPAY_TOKENIZATION_NETWORK_ERROR Occurs when the Braintree gateway cannot be reached.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n UNIONPAY_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_NOT_ENABLED\",\n message: \"UnionPay is not enabled for this merchant.\"\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID\",\n message: \"Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance.\"\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED\",\n message: \"Could not find the Hosted Fields instance.\"\n },\n UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED\",\n message: \"A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance.\"\n },\n UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES\",\n message: \"Please supply either a card or a Hosted Fields instance, not both.\"\n },\n UNIONPAY_EXPIRATION_DATE_INCOMPLETE: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_EXPIRATION_DATE_INCOMPLETE\",\n message: \"You must supply expiration month and year or neither.\"\n },\n UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID: {\n type: BraintreeError.types.CUSTOMER,\n code: \"UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID\",\n message: \"Enrollment failed due to user input error.\"\n },\n UNIONPAY_ENROLLMENT_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_ENROLLMENT_NETWORK_ERROR\",\n message: \"Could not enroll UnionPay card.\"\n },\n UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR\",\n message: \"Could not fetch card capabilities.\"\n },\n UNIONPAY_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_TOKENIZATION_NETWORK_ERROR\",\n message: \"A tokenization network error occurred.\"\n },\n UNIONPAY_MISSING_MOBILE_PHONE_DATA: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_MISSING_MOBILE_PHONE_DATA\",\n message: \"A `mobile` with `countryCode` and `number` is required.\"\n },\n UNIONPAY_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: \"UNIONPAY_FAILED_TOKENIZATION\",\n message: \"The supplied card data failed tokenization.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 205: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var analytics = _dereq_(\"../../lib/analytics\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var Bus = _dereq_(\"framebus\");\n var constants = _dereq_(\"./constants\");\n var isVerifiedDomain = _dereq_(\"../../lib/is-verified-domain\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\n var errors = _dereq_(\"./errors\");\n var events = constants.events;\n var iFramer = _dereq_(\"@braintree/iframer\");\n var methods = _dereq_(\"../../lib/methods\");\n var VERSION = \"3.101.1\";\n var uuid = _dereq_(\"@braintree/uuid\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BUS_CONFIGURATION_REQUEST_EVENT = _dereq_(\"../../lib/constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/unionpay.create|unionpay.create}.\n * @description You cannot use this constructor directly. Use {@link module:braintree-web/unionpay.create|braintree-web.unionpay.create} instead.\n * @classdesc This class represents a UnionPay component. Instances of this class have methods for {@link UnionPay#fetchCapabilities fetching capabilities} of UnionPay cards, {@link UnionPay#enroll enrolling} a UnionPay card, and {@link UnionPay#tokenize tokenizing} a UnionPay card.\n */\n function UnionPay(options) {\n this._options = options;\n }\n\n /**\n * @typedef {object} UnionPay~fetchCapabilitiesPayload\n * @property {boolean} isUnionPay Determines if this card is a UnionPay card.\n * @property {boolean} isDebit Determines if this card is a debit card. This property is only present if `isUnionPay` is `true`.\n * @property {object} unionPay UnionPay specific properties. This property is only present if `isUnionPay` is `true`.\n * @property {boolean} unionPay.supportsTwoStepAuthAndCapture Determines if the card allows for an authorization, but settling the transaction later.\n * @property {boolean} unionPay.isSupported Determines if Braintree can process this UnionPay card. When false, Braintree cannot process this card and the user should use a different card.\n */\n\n /**\n * Fetches the capabilities of a card, including whether or not the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay {@link UnionPay#fetchCapabilities fetchCapabilities} options\n * @param {object} [options.card] The card from which to fetch capabilities. Note that this will only have one property, `number`. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number Card number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {callback} [callback] The second argument, data, is a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}. If no callback is provided, `fetchCapabilities` returns a promise that resolves with a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n UnionPay.prototype.fetchCapabilities = function (options) {\n var self = this;\n var client = this._options.client;\n var cardNumber = options.card ? options.card.number : null;\n var hostedFields = options.hostedFields;\n if (cardNumber && hostedFields) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n } else if (cardNumber) {\n return client.request({\n method: \"get\",\n endpoint: \"payment_methods/credit_cards/capabilities\",\n data: {\n _meta: {\n source: \"unionpay\"\n },\n creditCard: {\n number: cardNumber\n }\n }\n }).then(function (response) {\n analytics.sendEvent(client, \"unionpay.capabilities-received\");\n return response;\n }).catch(function (err) {\n var status = err.details && err.details.httpStatus;\n analytics.sendEvent(client, \"unionpay.capabilities-failed\");\n if (status === 403) {\n return Promise.reject(err);\n }\n return Promise.reject(new BraintreeError({\n type: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,\n code: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,\n message: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,\n details: {\n originalError: err\n }\n }));\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n }\n return self._initializeHostedFields().then(function () {\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.HOSTED_FIELDS_FETCH_CAPABILITIES, {\n hostedFields: hostedFields\n }, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n resolve(response.payload);\n });\n });\n });\n }\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n\n /**\n * @typedef {object} UnionPay~enrollPayload\n * @property {string} enrollmentId UnionPay enrollment ID. This value should be passed to `tokenize`.\n * @property {boolean} smsCodeRequired UnionPay `smsCodeRequired` flag.\n *

true - the user will receive an SMS code that needs to be supplied for tokenization.\n *

false - the card can be immediately tokenized.\n */\n\n /**\n * Enrolls a UnionPay card. Use {@link UnionPay#fetchCapabilities|fetchCapabilities} to determine if the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay enrollment options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {object} options.mobile The mobile information collected from the customer.\n * @param {string} options.mobile.countryCode The country code of the customer's mobile phone number.\n * @param {string} options.mobile.number The customer's mobile phone number.\n * @param {callback} [callback] The second argument, data, is a {@link UnionPay~enrollPayload|enrollPayload}. If no callback is provided, `enroll` returns a promise that resolves with {@link UnionPay~enrollPayload|enrollPayload}.\n * @returns {void}\n */\n UnionPay.prototype.enroll = function (options) {\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var mobile = options.mobile;\n var hostedFields = options.hostedFields;\n var data;\n if (!mobile) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_MISSING_MOBILE_PHONE_DATA));\n }\n if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n } else if (card) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n }\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(events.HOSTED_FIELDS_ENROLL, {\n hostedFields: hostedFields,\n mobile: mobile\n }, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n resolve(response.payload);\n });\n });\n });\n } else if (card && card.number) {\n data = {\n _meta: {\n source: \"unionpay\"\n },\n unionPayEnrollment: {\n number: card.number,\n mobileCountryCode: mobile.countryCode,\n mobileNumber: mobile.number\n }\n };\n if (card.expirationDate) {\n data.unionPayEnrollment.expirationDate = card.expirationDate;\n } else if (card.expirationMonth || card.expirationYear) {\n if (card.expirationMonth && card.expirationYear) {\n data.unionPayEnrollment.expirationYear = card.expirationYear;\n data.unionPayEnrollment.expirationMonth = card.expirationMonth;\n } else {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_EXPIRATION_DATE_INCOMPLETE));\n }\n }\n return client.request({\n method: \"post\",\n endpoint: \"union_pay_enrollments\",\n data: data\n }).then(function (response) {\n analytics.sendEvent(client, \"unionpay.enrollment-succeeded\");\n return {\n enrollmentId: response.unionPayEnrollmentId,\n smsCodeRequired: response.smsCodeRequired\n };\n }).catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(errors.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID);\n error.details = {\n originalError: err\n };\n } else {\n error = new BraintreeError(errors.UNIONPAY_ENROLLMENT_NETWORK_ERROR);\n error.details = {\n originalError: err\n };\n }\n analytics.sendEvent(client, \"unionpay.enrollment-failed\");\n return Promise.reject(error);\n });\n }\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n\n /**\n * @typedef {object} UnionPay~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type Always CreditCard.\n * @property {object} details Additional account details:\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n */\n\n /**\n * Tokenizes a UnionPay card and returns a nonce payload.\n * @public\n * @param {object} options UnionPay tokenization options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.cvv] The card's security number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {string} options.enrollmentId The enrollment ID from {@link UnionPay#enroll}.\n * @param {string} [options.smsCode] The SMS code received from the user if {@link UnionPay#enroll} payload have `smsCodeRequired`. if `smsCodeRequired` is false, smsCode should not be passed.\n * @param {callback} [callback] The second argument, data, is a {@link UnionPay~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with a {@link UnionPay~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n UnionPay.prototype.tokenize = function (options) {\n var data;\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var hostedFields = options.hostedFields;\n if (card && hostedFields) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));\n } else if (card) {\n data = {\n _meta: {\n source: \"unionpay\"\n },\n creditCard: {\n number: options.card.number,\n options: {\n unionPayEnrollment: {\n id: options.enrollmentId\n }\n }\n }\n };\n if (options.smsCode) {\n data.creditCard.options.unionPayEnrollment.smsCode = options.smsCode;\n }\n if (card.expirationDate) {\n data.creditCard.expirationDate = card.expirationDate;\n } else if (card.expirationMonth && card.expirationYear) {\n data.creditCard.expirationYear = card.expirationYear;\n data.creditCard.expirationMonth = card.expirationMonth;\n }\n if (options.card.cvv) {\n data.creditCard.cvv = options.card.cvv;\n }\n return client.request({\n method: \"post\",\n endpoint: \"payment_methods/credit_cards\",\n data: data\n }).then(function (response) {\n var tokenizedCard = response.creditCards[0];\n delete tokenizedCard.consumed;\n delete tokenizedCard.threeDSecureInfo;\n analytics.sendEvent(client, \"unionpay.nonce-received\");\n return tokenizedCard;\n }).catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n analytics.sendEvent(client, \"unionpay.nonce-failed\");\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(errors.UNIONPAY_FAILED_TOKENIZATION);\n error.details = {\n originalError: err\n };\n } else {\n error = new BraintreeError(errors.UNIONPAY_TOKENIZATION_NETWORK_ERROR);\n error.details = {\n originalError: err\n };\n }\n return Promise.reject(error);\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));\n }\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(events.HOSTED_FIELDS_TOKENIZE, options, function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n return;\n }\n resolve(response.payload);\n });\n });\n });\n }\n return Promise.reject(new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));\n };\n\n /**\n * Cleanly remove anything set up by {@link module:braintree-web/unionpay.create|create}. This only needs to be called when using UnionPay with Hosted Fields.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, returns a promise.\n * @example\n * unionpayInstance.teardown();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n UnionPay.prototype.teardown = function () {\n if (this._bus) {\n this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame);\n this._bus.teardown();\n }\n convertMethodsToError(this, methods(UnionPay.prototype));\n return Promise.resolve();\n };\n UnionPay.prototype._initializeHostedFields = function () {\n var assetsUrl, isDebug;\n var componentId = uuid();\n var self = this;\n if (this._hostedFieldsInitializePromise) {\n return this._hostedFieldsInitializePromise;\n }\n this._hostedFieldsInitializePromise = new Promise(function (resolve) {\n assetsUrl = self._options.client.getConfiguration().gatewayConfiguration.assetsUrl;\n isDebug = self._options.client.getConfiguration().isDebug;\n self._bus = new Bus({\n channel: componentId,\n verifyDomain: isVerifiedDomain\n });\n self._hostedFieldsFrame = iFramer({\n name: constants.HOSTED_FIELDS_FRAME_NAME + \"_\" + componentId,\n src: assetsUrl + \"/web/\" + VERSION + \"/html/unionpay-hosted-fields-frame\" + useMin(isDebug) + \".html\",\n height: 0,\n width: 0\n });\n self._bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply(self._options.client);\n resolve();\n });\n document.body.appendChild(self._hostedFieldsFrame);\n });\n return this._hostedFieldsInitializePromise;\n };\n module.exports = wrapPromise.wrapPrototype(UnionPay);\n }, {\n \"../../lib/analytics\": 119,\n \"../../lib/braintree-error\": 124,\n \"../../lib/constants\": 126,\n \"../../lib/convert-methods-to-error\": 127,\n \"../../lib/is-verified-domain\": 153,\n \"../../lib/methods\": 155,\n \"../../lib/use-min\": 160,\n \"./constants\": 203,\n \"./errors\": 204,\n \"@braintree/iframer\": 35,\n \"@braintree/uuid\": 39,\n \"@braintree/wrap-promise\": 43,\n \"framebus\": 52\n }],\n 206: [function (_dereq_, module, exports) {\n \"use strict\";\n\n module.exports = {\n PLAID_LINK_JS: \"https://cdn.plaid.com/link/v2/stable/link-initialize.js\"\n };\n }, {}],\n 207: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Us Bank Account - Creation Error Codes\n * @description Errors that occur when [creating the Us Bank Account component](./module-braintree-web_us-bank-account.html#.create).\n * @property {MERCHANT} US_BANK_ACCOUNT_NOT_ENABLED Occurs when US Bank Account is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Us Bank Account - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UsBankAccount.html#tokenize).\n * @property {MERCHANT} US_BANK_ACCOUNT_OPTION_REQUIRED Occurs when a required option is not passed.\n * @property {MERCHANT} US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS Occurs when 1 or more incompatible options are passed.\n * @property {NETWORK} US_BANK_ACCOUNT_LOGIN_LOAD_FAILED Occurs when bank login flow fails.\n * @property {CUSTOMER} US_BANK_ACCOUNT_LOGIN_CLOSED Occurs when bank login window is closed.\n * @property {MERCHANT} US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE Occurs when a bank login flow is already active.\n * @property {NETWORK} US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR Occurs when payment details could not be tokenized.\n * @property {CUSTOMER} US_BANK_ACCOUNT_FAILED_TOKENIZATION Occurs when payment details failed to be tokenized.\n * @property {MERCHANT} US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED Occurs when bank login flow is not enabled in the Braintree control panel.\n */\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n module.exports = {\n US_BANK_ACCOUNT_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_OPTION_REQUIRED\"\n },\n US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS\"\n },\n US_BANK_ACCOUNT_LOGIN_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"US_BANK_ACCOUNT_LOGIN_LOAD_FAILED\",\n message: \"Bank login flow failed to load.\"\n },\n US_BANK_ACCOUNT_LOGIN_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"US_BANK_ACCOUNT_LOGIN_CLOSED\",\n message: \"Customer closed bank login flow before authorizing.\"\n },\n US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE\",\n message: \"Another bank login tokenization request is active.\"\n },\n US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR\",\n message: \"A tokenization network error occurred.\"\n },\n US_BANK_ACCOUNT_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: \"US_BANK_ACCOUNT_FAILED_TOKENIZATION\",\n message: \"The supplied data failed tokenization.\"\n },\n US_BANK_ACCOUNT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_NOT_ENABLED\",\n message: \"US bank account is not enabled.\"\n },\n US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED\",\n message: \"Bank login is not enabled.\"\n }\n };\n }, {\n \"../lib/braintree-error\": 124\n }],\n 208: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/us-bank-account\n * @description This module is for accepting payments of US bank accounts.\n */\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var errors = _dereq_(\"./errors\");\n var USBankAccount = _dereq_(\"./us-bank-account\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link USBankAccount} instance. If no callback is provided, `create` returns a promise that resolves with the {@link USBankAccount} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"US Bank Account\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n var usBankAccount;\n options.client = client;\n usBankAccount = options.client.getConfiguration().gatewayConfiguration.usBankAccount;\n if (!usBankAccount) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_NOT_ENABLED));\n }\n return new USBankAccount(options);\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./errors\": 207,\n \"./us-bank-account\": 209,\n \"@braintree/wrap-promise\": 43\n }],\n 209: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var constants = _dereq_(\"./constants\");\n var errors = _dereq_(\"./errors\");\n var sharedErrors = _dereq_(\"../lib/errors\");\n var analytics = _dereq_(\"../lib/analytics\");\n var once = _dereq_(\"../lib/once\");\n var convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\n var methods = _dereq_(\"../lib/methods\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var TOKENIZE_BANK_DETAILS_MUTATION = createGraphQLMutation(\"UsBankAccount\");\n var TOKENIZE_BANK_LOGIN_MUTATION = createGraphQLMutation(\"UsBankLogin\");\n\n /**\n * @typedef {object} USBankAccount~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `us_bank_account`.\n * @property {object} details Additional account details. Currently empty.\n */\n\n /**\n * @class\n * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}.\n * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead.\n */\n function USBankAccount(options) {\n this._client = options.client;\n this._isTokenizingBankLogin = false;\n analytics.sendEvent(this._client, \"usbankaccount.initialized\");\n }\n\n /**\n * Tokenizes bank information to return a payment method nonce. You can tokenize bank details by providing information like account and routing numbers. You can also tokenize with a bank login UI that prompts the customer to log into their bank account.\n * @public\n * @param {object} options All tokenization options for the US Bank Account component.\n * @param {string} options.mandateText A string for proof of customer authorization. For example, `'I authorize Braintree to debit my bank account on behalf of My Online Store.'`.\n * @param {object} [options.bankDetails] Bank detail information (such as account and routing numbers). `bankDetails` or `bankLogin` option must be provided.\n * @param {string} options.bankDetails.routingNumber The customer's bank routing number, such as `'307075259'`.\n * @param {string} options.bankDetails.accountNumber The customer's bank account number, such as `'999999999'`.\n * @param {string} options.bankDetails.accountType The customer's bank account type. Must be `'checking'` or `'savings'`.\n * @param {string} options.bankDetails.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankDetails.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankDetails.billingAddress The customer's billing address.\n * @param {string} options.bankDetails.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankDetails.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankDetails.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankDetails.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankDetails.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {object} [options.bankLogin] Bank login information. `bankLogin` or `bankDetails` option must be provided.\n * @param {string} options.bankLogin.displayName Display name for the bank login UI, such as `'My Store'`.\n * @param {string} options.bankLogin.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankLogin.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankLogin.billingAddress The customer's billing address.\n * @param {string} options.bankLogin.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankLogin.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankLogin.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankLogin.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankLogin.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {callback} [callback] The second argument, data, is a {@link USBankAccount~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with {@link USBankAccount~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * Tokenizing raw bank details\n * var routingNumberInput = document.querySelector('input[name=\"routing-number\"]');\n * var accountNumberInput = document.querySelector('input[name=\"account-number\"]');\n * var accountTypeInput = document.querySelector('input[name=\"account-type\"]:checked');\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * submitButton.addEventListener('click', function (event) {\n * var bankDetails = {\n * routingNumber: routingNumberInput.value,\n * accountNumber: accountNumberInput.value,\n * accountType: accountTypeInput.value,\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * };\n *\n * if (bankDetails.ownershipType === 'personal') {\n * bankDetails.firstName = firstNameInput.value;\n * bankDetails.lastName = lastNameInput.value;\n * } else {\n * bankDetails.businessName = businessNameInput.value;\n * }\n *\n * event.preventDefault();\n *\n * usBankAccountInstance.tokenize({\n * bankDetails: bankDetails,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n * @example\n * Tokenizing with bank login UI\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * bankLoginButton.addEventListener('click', function (event) {\n * var bankLogin = {\n * displayName: 'My Online Store',\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * }\n * event.preventDefault();\n *\n * if (bankLogin.ownershipType === 'personal') {\n * bankLogin.firstName = firstNameInput.value;\n * bankLogin.lastName = lastNameInput.value;\n * } else {\n * bankLogin.businessName = businessNameInput.value;\n * }\n *\n * usBankAccountInstance.tokenize({\n * bankLogin: bankLogin,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n */\n USBankAccount.prototype.tokenize = function (options) {\n options = options || {};\n if (!options.mandateText) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"mandateText property is required.\"\n }));\n }\n if (options.bankDetails && options.bankLogin) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,\n code: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,\n message: \"tokenize must be called with bankDetails or bankLogin, not both.\"\n }));\n } else if (options.bankDetails) {\n return this._tokenizeBankDetails(options);\n } else if (options.bankLogin) {\n return this._tokenizeBankLogin(options);\n }\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"tokenize must be called with bankDetails or bankLogin.\"\n }));\n };\n USBankAccount.prototype._tokenizeBankDetails = function (options) {\n var client = this._client;\n var bankDetails = options.bankDetails;\n var data = {\n achMandate: options.mandateText,\n routingNumber: bankDetails.routingNumber,\n accountNumber: bankDetails.accountNumber,\n accountType: bankDetails.accountType.toUpperCase(),\n billingAddress: formatBillingAddressForGraphQL(bankDetails.billingAddress || {})\n };\n formatDataForOwnershipType(data, bankDetails);\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: TOKENIZE_BANK_DETAILS_MUTATION,\n variables: {\n input: {\n usBankAccount: data\n }\n }\n }\n }).then(function (response) {\n analytics.sendEvent(client, \"usbankaccount.bankdetails.tokenization.succeeded\");\n return Promise.resolve(formatTokenizeResponseFromGraphQL(response, \"tokenizeUsBankAccount\"));\n }).catch(function (err) {\n var error = errorFrom(err);\n analytics.sendEvent(client, \"usbankaccount.bankdetails.tokenization.failed\");\n return Promise.reject(error);\n });\n };\n USBankAccount.prototype._tokenizeBankLogin = function (options) {\n var self = this;\n var client = this._client;\n var gatewayConfiguration = client.getConfiguration().gatewayConfiguration;\n var isProduction = gatewayConfiguration.environment === \"production\";\n var plaidConfig = gatewayConfiguration.usBankAccount.plaid;\n if (!options.bankLogin.displayName) {\n return Promise.reject(new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"displayName property is required when using bankLogin.\"\n }));\n }\n if (!plaidConfig) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED));\n }\n if (this._isTokenizingBankLogin) {\n return Promise.reject(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE));\n }\n this._isTokenizingBankLogin = true;\n return new Promise(function (resolve, reject) {\n self._loadPlaid(function (plaidLoadErr, plaid) {\n if (plaidLoadErr) {\n reject(plaidLoadErr);\n return;\n }\n plaid.create({\n clientName: options.bankLogin.displayName,\n apiVersion: \"v2\",\n env: isProduction ? \"production\" : \"sandbox\",\n key: plaidConfig.publicKey,\n product: \"auth\",\n selectAccount: true,\n onExit: function () {\n self._isTokenizingBankLogin = false;\n analytics.sendEvent(client, \"usbankaccount.banklogin.tokenization.closed.by-user\");\n reject(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_CLOSED));\n },\n onSuccess: function (publicToken, metadata) {\n var bankLogin = options.bankLogin;\n var data = {\n publicToken: publicToken,\n accountId: isProduction ? metadata.account_id : \"plaid_account_id\",\n accountType: metadata.account.subtype.toUpperCase(),\n achMandate: options.mandateText,\n billingAddress: formatBillingAddressForGraphQL(bankLogin.billingAddress || {})\n };\n formatDataForOwnershipType(data, bankLogin);\n client.request({\n api: \"graphQLApi\",\n data: {\n query: TOKENIZE_BANK_LOGIN_MUTATION,\n variables: {\n input: {\n usBankLogin: data\n }\n }\n }\n }).then(function (response) {\n self._isTokenizingBankLogin = false;\n analytics.sendEvent(client, \"usbankaccount.banklogin.tokenization.succeeded\");\n resolve(formatTokenizeResponseFromGraphQL(response, \"tokenizeUsBankLogin\"));\n }).catch(function (tokenizeErr) {\n var error;\n self._isTokenizingBankLogin = false;\n error = errorFrom(tokenizeErr);\n analytics.sendEvent(client, \"usbankaccount.banklogin.tokenization.failed\");\n reject(error);\n });\n }\n }).open();\n analytics.sendEvent(client, \"usbankaccount.banklogin.tokenization.started\");\n });\n });\n };\n function errorFrom(err) {\n var error;\n var status = err.details && err.details.httpStatus;\n if (status === 401) {\n error = new BraintreeError(sharedErrors.BRAINTREE_API_ACCESS_RESTRICTED);\n } else if (status < 500) {\n error = new BraintreeError(errors.US_BANK_ACCOUNT_FAILED_TOKENIZATION);\n } else {\n error = new BraintreeError(errors.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR);\n }\n error.details = {\n originalError: err\n };\n return error;\n }\n function formatTokenizeResponseFromGraphQL(response, type) {\n var data = response.data[type].paymentMethod;\n var last4 = data.details.last4;\n var description = \"US bank account ending in - \" + last4;\n return {\n nonce: data.id,\n details: {},\n description: description,\n type: \"us_bank_account\"\n };\n }\n USBankAccount.prototype._loadPlaid = function (callback) {\n var existingScript, script;\n callback = once(callback);\n if (window.Plaid) {\n callback(null, window.Plaid);\n return;\n }\n existingScript = document.querySelector('script[src=\"' + constants.PLAID_LINK_JS + '\"]');\n if (existingScript) {\n addLoadListeners(existingScript, callback);\n } else {\n script = document.createElement(\"script\");\n script.src = constants.PLAID_LINK_JS;\n script.async = true;\n addLoadListeners(script, callback);\n document.body.appendChild(script);\n this._plaidScript = script;\n }\n };\n function addLoadListeners(script, callback) {\n function loadHandler() {\n var readyState = this.readyState; // eslint-disable-line no-invalid-this\n\n if (!readyState || readyState === \"loaded\" || readyState === \"complete\") {\n removeLoadListeners();\n callback(null, window.Plaid);\n }\n }\n function errorHandler() {\n script.parentNode.removeChild(script);\n callback(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED));\n }\n function removeLoadListeners() {\n script.removeEventListener(\"error\", errorHandler);\n script.removeEventListener(\"load\", loadHandler);\n script.removeEventListener(\"readystatechange\", loadHandler);\n }\n script.addEventListener(\"error\", errorHandler);\n script.addEventListener(\"load\", loadHandler);\n script.addEventListener(\"readystatechange\", loadHandler);\n }\n function formatBillingAddressForGraphQL(address) {\n return {\n streetAddress: address.streetAddress,\n extendedAddress: address.extendedAddress,\n city: address.locality,\n state: address.region,\n zipCode: address.postalCode\n };\n }\n function formatDataForOwnershipType(data, details) {\n if (details.ownershipType === \"personal\") {\n data.individualOwner = {\n firstName: details.firstName,\n lastName: details.lastName\n };\n } else if (details.ownershipType === \"business\") {\n data.businessOwner = {\n businessName: details.businessName\n };\n }\n }\n function createGraphQLMutation(type) {\n return \"\" + \"mutation Tokenize\" + type + \"($input: Tokenize\" + type + \"Input!) {\" + \" tokenize\" + type + \"(input: $input) {\" + \" paymentMethod {\" + \" id\" + \" details {\" + \" ... on UsBankAccountDetails {\" + \" last4\" + \" }\" + \" }\" + \" }\" + \" }\" + \"}\";\n }\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/us-bank-account.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * usBankAccountInstance.teardown();\n * @example With callback\n * usBankAccountInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n USBankAccount.prototype.teardown = function () {\n if (this._plaidScript) {\n document.body.removeChild(this._plaidScript);\n }\n convertMethodsToError(this, methods(USBankAccount.prototype));\n return Promise.resolve();\n };\n module.exports = wrapPromise.wrapPrototype(USBankAccount);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/braintree-error\": 124,\n \"../lib/convert-methods-to-error\": 127,\n \"../lib/errors\": 135,\n \"../lib/methods\": 155,\n \"../lib/once\": 156,\n \"./constants\": 206,\n \"./errors\": 207,\n \"@braintree/wrap-promise\": 43\n }],\n 210: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Vault Manager - deletePaymentMethod Error Codes\n * @description Errors that occur when using the [`deletePaymentMethod` method](./VaultManager.html#deletePaymentMethod).\n * @property {MERCHANT} VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN Occurs when vault manager is initialized with a tokenization key instead of a Client Token.\n * @property {MERCHANT} VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND Occurs when the specified payment method can not be found.\n * @property {UNKNOWN} VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR Occurs when there is an error attempting to delete the payment method.\n */\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n module.exports = {\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN: {\n type: BraintreeError.types.MERCHANT,\n code: \"VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN\",\n message: \"A client token with a customer id must be used to delete a payment method nonce.\"\n },\n VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND: {\n type: BraintreeError.types.MERCHANT,\n code: \"VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND\"\n },\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR\"\n }\n };\n }, {\n \"../lib/braintree-error\": 124\n }],\n 211: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/vault-manager\n * @description Manages customer's payment methods.\n */\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var VaultManager = _dereq_(\"./vault-manager\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link VaultManager} instance.\n * @returns {void}\n */\n function create(options) {\n var name = \"Vault Manager\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return new VaultManager({\n createPromise: createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n })\n });\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/basic-component-verification\": 122,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./vault-manager\": 212,\n \"@braintree/wrap-promise\": 43\n }],\n 212: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var analytics = _dereq_(\"../lib/analytics\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var errors = _dereq_(\"./errors\");\n var convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\n var methods = _dereq_(\"../lib/methods\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var DELETE_PAYMENT_METHOD_MUTATION = \"mutation DeletePaymentMethodFromSingleUseToken($input: DeletePaymentMethodFromSingleUseTokenInput!) {\" + \" deletePaymentMethodFromSingleUseToken(input: $input) {\" + \" clientMutationId\" + \" }\" + \"}\";\n\n /**\n * @typedef {array} VaultManager~fetchPaymentMethodsPayload The customer's payment methods.\n * @property {object} paymentMethod The payment method object.\n * @property {string} paymentMethod.nonce A nonce that can be sent to your server to transact on the payment method.\n * @property {boolean} paymentMethod.default Whether or not this is the default payment method for the customer.\n * @property {object} paymentMethod.details Any additional details about the payment method. Varies depending on the type of payment method.\n * @property {string} paymentMethod.type A constant indicating the type of payment method.\n * @property {?string} paymentMethod.description Additional description about the payment method.\n * @property {?object} paymentMethod.binData Bin data about the payment method.\n *\n */\n\n /**\n * @class\n * @param {object} options Options\n * @description You cannot use this constructor directly. Use {@link module:braintree-web/vault-manager.create|braintree.vault-manager.create} instead.\n * @classdesc This class allows you to manage a customer's payment methods on the client.\n */\n function VaultManager(options) {\n this._createPromise = options.createPromise;\n }\n\n /**\n * Fetches payment methods owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @param {object} [options] Options for fetching payment methods.\n * @param {boolean} [options.defaultFirst = false] If `true`, the payment methods will be returned with the default payment method for the customer first. Otherwise, order is not guaranteed.\n * @param {callback} [callback] The second argument is a {@link VaultManager~fetchPaymentMethodsPayload|fetchPaymentMethodsPayload}. This is also what is resolved by the promise if no callback is provided.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.fetchPaymentMethods(function (err, paymentMethods) {\n * paymentMethods.forEach(function (paymentMethod) {\n * // add payment method to UI\n * // paymentMethod.nonce <- transactable nonce associated with payment method\n * // paymentMethod.details <- object with additional information about payment method\n * // paymentMethod.type <- a constant signifying the type\n * });\n * });\n */\n VaultManager.prototype.fetchPaymentMethods = function (options) {\n var defaultFirst;\n options = options || {};\n defaultFirst = options.defaultFirst === true ? 1 : 0;\n return this._createPromise.then(function (client) {\n return client.request({\n endpoint: \"payment_methods\",\n method: \"get\",\n data: {\n defaultFirst: defaultFirst\n }\n });\n }).then(function (paymentMethodsPayload) {\n analytics.sendEvent(this._createPromise, \"vault-manager.fetch-payment-methods.succeeded\");\n return paymentMethodsPayload.paymentMethods.map(formatPaymentMethodPayload);\n }.bind(this));\n };\n\n /**\n * Deletes a payment method owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @param {string} paymentMethodNonce The payment method nonce that references a vaulted payment method.\n * @param {callback} [callback] No data is returned if the operation is successful.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.deletePaymentMethod('nonce-to-delete', function (err) {\n * // handle err if it exists\n * });\n */\n VaultManager.prototype.deletePaymentMethod = function (paymentMethodNonce) {\n return this._createPromise.then(function (client) {\n var usesClientToken = client.getConfiguration().authorizationType === \"CLIENT_TOKEN\";\n if (!usesClientToken) {\n return Promise.reject(new BraintreeError(errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN));\n }\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: DELETE_PAYMENT_METHOD_MUTATION,\n variables: {\n input: {\n singleUseTokenId: paymentMethodNonce\n }\n },\n operationName: \"DeletePaymentMethodFromSingleUseToken\"\n }\n }).then(function () {\n analytics.sendEvent(client, \"vault-manager.delete-payment-method.succeeded\");\n\n // noop to prevent sending back the raw graphql data\n }).catch(function (error) {\n var originalError = error.details.originalError;\n var formattedError;\n analytics.sendEvent(client, \"vault-manager.delete-payment-method.failed\");\n if (originalError[0] && originalError[0].extensions.errorClass === \"NOT_FOUND\") {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.type,\n code: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.code,\n message: \"A payment method for payment method nonce `\" + paymentMethodNonce + \"` could not be found.\",\n details: {\n originalError: originalError\n }\n });\n }\n if (!formattedError) {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.type,\n code: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.code,\n message: \"An unknown error occured when attempting to delete the payment method assocaited with the payment method nonce `\" + paymentMethodNonce + \"`.\",\n details: {\n originalError: originalError\n }\n });\n }\n return Promise.reject(formattedError);\n });\n });\n };\n function formatPaymentMethodPayload(paymentMethod) {\n var formattedPaymentMethod = {\n nonce: paymentMethod.nonce,\n default: paymentMethod.default,\n details: paymentMethod.details,\n hasSubscription: paymentMethod.hasSubscription,\n type: paymentMethod.type\n };\n if (paymentMethod.description) {\n formattedPaymentMethod.description = paymentMethod.description;\n }\n if (paymentMethod.binData) {\n formattedPaymentMethod.binData = paymentMethod.binData;\n }\n return formattedPaymentMethod;\n }\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/vault-manager.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * vaultManagerInstance.teardown();\n * @example With callback\n * vaultManagerInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n VaultManager.prototype.teardown = function () {\n convertMethodsToError(this, methods(VaultManager.prototype));\n return Promise.resolve();\n };\n module.exports = wrapPromise.wrapPrototype(VaultManager);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/braintree-error\": 124,\n \"../lib/convert-methods-to-error\": 127,\n \"../lib/methods\": 155,\n \"./errors\": 210,\n \"@braintree/wrap-promise\": 43\n }],\n 213: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n };\n var venmo_desktop_1 = __importDefault(_dereq_(\"./venmo-desktop\"));\n module.exports = function createVenmoDesktop(options) {\n var instance = new venmo_desktop_1.default(options);\n return instance.initialize();\n };\n }, {\n \"./venmo-desktop\": 215\n }],\n 214: [function (_dereq_, module, exports) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.VENMO_PAYMENT_CONTEXT_STATUS_QUERY = exports.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY = exports.UPDATE_PAYMENT_CONTEXT_QUERY = exports.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY = exports.CREATE_PAYMENT_CONTEXT_QUERY = exports.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY = void 0;\n exports.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY = \"mutation CreateVenmoQRCodePaymentContext($input: CreateVenmoQRCodePaymentContextInput!) {\\n createVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n venmoQRCodePaymentContext {\\n id\\n merchantId\\n createdAt\\n expiresAt\\n }\\n }\\n}\";\n exports.CREATE_PAYMENT_CONTEXT_QUERY = \"mutation CreateVenmoPaymentContext($input: CreateVenmoPaymentContextInput!) {\\n createVenmoPaymentContext(input: $input) {\\n clientMutationId\\n venmoPaymentContext {\\n id\\n merchantId\\n createdAt\\n expiresAt\\n }\\n }\\n}\";\n exports.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY = \"mutation UpdateVenmoQRCodePaymentContext($input: UpdateVenmoQRCodePaymentContextInput!) {\\n updateVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n }\\n}\";\n exports.UPDATE_PAYMENT_CONTEXT_QUERY = \"mutation UpdateVenmoPaymentContextStatus($input: UpdateVenmoPaymentContextStatusInput!) {\\n updateVenmoPaymentContextStatus(input: $input) {\\n clientMutationId\\n }\\n}\";\n exports.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY = \"query PaymentContext($id: ID!) {\\n node(id: $id) {\\n ... on VenmoQRCodePaymentContext {\\n status\\n paymentMethodId\\n userName\\n }\\n }\\n}\";\n exports.VENMO_PAYMENT_CONTEXT_STATUS_QUERY = \"query PaymentContext($id: ID!) {\\n node(id: $id) {\\n ... on VenmoPaymentContext {\\n status\\n paymentMethodId\\n userName\\n payerInfo {\\n firstName\\n lastName\\n phoneNumber\\n email\\n externalId\\n userName\\n billingAddress {\\n fullName\\n addressLine1\\n addressLine2\\n adminArea1\\n adminArea2\\n postalCode\\n countryCode\\n }\\n shippingAddress {\\n fullName\\n addressLine1\\n addressLine2\\n adminArea1\\n adminArea2\\n postalCode\\n countryCode\\n }\\n }\\n }\\n }\\n}\";\n }, {}],\n 215: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n var __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n };\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n var framebus_1 = __importDefault(_dereq_(\"framebus\"));\n var iframer_1 = __importDefault(_dereq_(\"@braintree/iframer\"));\n var uuid_1 = __importDefault(_dereq_(\"@braintree/uuid\"));\n var events_1 = _dereq_(\"../shared/events\");\n var queries_1 = _dereq_(\"./queries\");\n var VENMO_DESKTOP_POLLING_INTERVAL = 1000; // 1 second\n var VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION = 2000; // 2 seconds\n var VenmoDesktop = /** @class */function () {\n function VenmoDesktop(options) {\n this.isHidden = true;\n this.env = options.environment;\n this.id = uuid_1.default();\n this.profileId = options.profileId;\n this.displayName = options.displayName;\n this.paymentMethodUsage = options.paymentMethodUsage;\n this.shouldUseLegacyQRCodeMutation = !this.paymentMethodUsage;\n var frameUrl = options.url + \"#\" + this.env + \"_\" + this.id;\n this.bus = new framebus_1.default({\n channel: this.id,\n verifyDomain: options.verifyDomain,\n targetFrames: []\n });\n this.apiRequest = options.apiRequest;\n this.sendEvent = options.sendEvent;\n this.Promise = options.Promise;\n this.alertBox = document.createElement(\"div\");\n this.alertBox.setAttribute(\"data-venmo-desktop-id\", this.id);\n this.alertBox.setAttribute(\"role\", \"alert\");\n this.alertBox.style.position = \"fixed\";\n this.alertBox.style.display = \"none\";\n this.alertBox.style.height = \"1px\";\n this.alertBox.style.width = \"1px\";\n this.alertBox.style.overflow = \"hidden\";\n this.alertBox.style.zIndex = \"0\";\n this.iframe = iframer_1.default({\n src: frameUrl,\n name: \"venmo-desktop-iframe\",\n style: {\n display: \"none\",\n position: \"fixed\",\n top: \"0\",\n bottom: \"0\",\n right: \"0\",\n left: \"0\",\n height: \"100%\",\n width: \"100%\",\n zIndex: \"9999999\"\n },\n title: \"Venmo Desktop\"\n });\n this.bus.addTargetFrame(this.iframe);\n }\n VenmoDesktop.prototype.initialize = function () {\n var _this = this;\n return new this.Promise(function (resolve) {\n _this.bus.on(events_1.VENMO_DESKTOP_IFRAME_READY, function () {\n resolve(_this);\n });\n _this.bus.on(events_1.VENMO_DESKTOP_REQUEST_NEW_QR_CODE, function () {\n _this.sendEvent(\"venmo.tokenize.desktop.restarted-from-error-view\");\n _this.startPolling();\n });\n document.body.appendChild(_this.iframe);\n document.body.appendChild(_this.alertBox);\n });\n };\n VenmoDesktop.prototype.launchDesktopFlow = function () {\n var _this = this;\n this.isHidden = false;\n var promise = new this.Promise(function (resolve, reject) {\n _this.launchDesktopPromiseRejectFunction = reject;\n var removeListeners = function () {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n _this.bus.off(events_1.VENMO_DESKTOP_CUSTOMER_CANCELED, customerCancelledHandler);\n _this.bus.off(events_1.VENMO_DESKTOP_UNKNOWN_ERROR, unknownErrorHandler);\n /* eslint-enable @typescript-eslint/no-use-before-define */\n };\n var unknownErrorHandler = function (err) {\n removeListeners();\n _this.sendEvent(\"venmo.tokenize.desktop.unknown-error\");\n reject({\n allowUIToHandleError: false,\n reason: \"UNKNOWN_ERROR\",\n err: err\n });\n };\n var customerCancelledHandler = function () {\n removeListeners();\n _this.updateVenmoDesktopPaymentContext(\"CANCELED\");\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.canceled-from-modal\");\n reject({\n allowUIToHandleError: false,\n reason: \"CUSTOMER_CANCELED\"\n });\n };\n _this.completedHandler = function (payload) {\n removeListeners();\n resolve(payload);\n };\n _this.bus.on(events_1.VENMO_DESKTOP_CUSTOMER_CANCELED, customerCancelledHandler);\n _this.bus.on(events_1.VENMO_DESKTOP_UNKNOWN_ERROR, unknownErrorHandler);\n });\n this.iframe.style.display = \"block\";\n this.setAlert(\"Generating a QR code, get your Venmo app ready\");\n this.iframe.focus();\n this.startPolling();\n return promise.then(function (result) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return result;\n }).catch(function (err) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return _this.Promise.reject(err);\n });\n };\n VenmoDesktop.prototype.triggerCompleted = function (result) {\n var _this = this;\n if (this.isHidden) {\n return;\n }\n setTimeout(function () {\n if (_this.completedHandler) {\n _this.completedHandler(result);\n }\n delete _this.completedHandler;\n }, VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION);\n };\n VenmoDesktop.prototype.triggerRejected = function (err) {\n if (this.launchDesktopPromiseRejectFunction) {\n this.launchDesktopPromiseRejectFunction(err);\n }\n };\n VenmoDesktop.prototype.hideDesktopFlow = function () {\n this.setAlert(\"\");\n this.iframe.style.display = \"none\";\n this.bus.emit(events_1.VENMO_DESKTOP_CLOSED_FROM_PARENT);\n this.isHidden = true;\n };\n VenmoDesktop.prototype.displayError = function (message) {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_ERROR, {\n message: message\n });\n this.setAlert(message);\n };\n VenmoDesktop.prototype.displayQRCode = function (id, merchantId) {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_QR_CODE, {\n id: id,\n merchantId: merchantId\n });\n this.setAlert(\"To scan the QR code, open your Venmo app\");\n };\n VenmoDesktop.prototype.authorize = function () {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZE);\n this.setAlert(\"Venmo account authorized\");\n };\n VenmoDesktop.prototype.authorizing = function () {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZING);\n this.setAlert(\"Authorize on your Venmo app\");\n };\n VenmoDesktop.prototype.startPolling = function () {\n var _this = this;\n return this.createVenmoDesktopPaymentContext().then(function (result) {\n var expiresIn = new Date(result.expiresAt).getTime() - new Date(result.createdAt).getTime();\n var expiredTime = Date.now() + expiresIn;\n _this.displayQRCode(result.id, result.merchantId);\n return _this.pollForStatusChange(result.status, expiredTime);\n }).then(function (result) {\n if (!result) {\n return;\n }\n // since we are manually adding a prepended @ sign\n // we want to make sure that the username does not\n // start giving us the @ sign up front in the future\n var username = result.userName || \"\";\n username = \"@\" + username.replace(\"@\", \"\");\n _this.triggerCompleted({\n paymentMethodNonce: result.paymentMethodId,\n username: username,\n payerInfo: result.payerInfo,\n id: _this.venmoContextId || \"\"\n });\n }).catch(function (err) {\n if (err.allowUIToHandleError) {\n // noop here and let the UI handle the customer error\n return;\n }\n _this.sendEvent(\"venmo.tokenize.desktop.unhandled-error\");\n _this.triggerRejected(err);\n });\n };\n VenmoDesktop.prototype.pollForStatusChange = function (status, expiredTime) {\n var _this = this;\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n if (Date.now() > expiredTime) {\n return this.updateVenmoDesktopPaymentContext(\"EXPIRED\").then(function () {\n _this.displayError(\"Something went wrong\");\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.sdk-timeout\");\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: \"TIMEOUT\"\n });\n });\n }\n return this.lookupVenmoDesktopPaymentContext().then(function (response) {\n if (!_this.venmoContextId || !response) {\n return _this.Promise.resolve();\n }\n var newStatus = response.status;\n if (newStatus !== status) {\n status = newStatus;\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.\" + status.toLowerCase());\n switch (status) {\n case \"CREATED\":\n // noop, no need to do anything here\n // should never be able to get to this point\n // but we'll keep it in to enumerate the statuses\n break;\n case \"EXPIRED\":\n case \"FAILED\":\n case \"CANCELED\":\n var message = status === \"CANCELED\" ? \"The authorization was canceled\" : \"Something went wrong\";\n _this.displayError(message);\n // these are all terminal states, so we end it here\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: status\n });\n case \"SCANNED\":\n _this.authorizing();\n break;\n case \"APPROVED\":\n _this.authorize();\n return _this.Promise.resolve(response);\n default:\n // any other statuses are irrelevant to the polling\n // and can just be ignored\n }\n }\n return new _this.Promise(function (resolve, reject) {\n setTimeout(function () {\n _this.pollForStatusChange(status, expiredTime).then(resolve).catch(reject);\n }, VENMO_DESKTOP_POLLING_INTERVAL);\n });\n });\n };\n VenmoDesktop.prototype.teardown = function () {\n this.bus.teardown();\n if (this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n }\n if (this.alertBox.parentNode) {\n this.alertBox.parentNode.removeChild(this.alertBox);\n }\n };\n VenmoDesktop.prototype.setAlert = function (message) {\n this.alertBox.style.display = message ? \"block\" : \"none\";\n this.alertBox.textContent = message;\n };\n VenmoDesktop.prototype.createPaymentContextFromGraphqlLegacyQRCodeMutation = function (intent) {\n return this.apiRequest(queries_1.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY, {\n input: {\n environment: this.env,\n intent: intent\n }\n }).then(function (response) {\n return response.createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n });\n };\n VenmoDesktop.prototype.createPaymentContextFromGraphQL = function (intent) {\n var input = {\n intent: intent,\n paymentMethodUsage: this.paymentMethodUsage,\n customerClient: \"DESKTOP\"\n };\n if (this.profileId) {\n input.merchantProfileId = this.profileId;\n }\n if (this.displayName) {\n input.displayName = this.displayName;\n }\n return this.apiRequest(queries_1.CREATE_PAYMENT_CONTEXT_QUERY, {\n input: input\n }).then(function (response) {\n return response.createVenmoPaymentContext.venmoPaymentContext;\n });\n };\n VenmoDesktop.prototype.createVenmoDesktopPaymentContext = function () {\n var _this = this;\n var contextPromise = this.shouldUseLegacyQRCodeMutation ? this.createPaymentContextFromGraphqlLegacyQRCodeMutation(\"PAY_FROM_APP\") : this.createPaymentContextFromGraphQL(\"PAY_FROM_APP\");\n return contextPromise.then(function (context) {\n _this.venmoContextId = context.id;\n var merchantId = _this.profileId || context.merchantId;\n return {\n id: context.id,\n status: context.status,\n merchantId: merchantId,\n createdAt: context.createdAt,\n expiresAt: context.expiresAt\n };\n });\n };\n VenmoDesktop.prototype.updateVenmoDesktopPaymentContext = function (status, additionalOptions) {\n if (additionalOptions === void 0) {\n additionalOptions = {};\n }\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n var data = {\n input: __assign({\n id: this.venmoContextId,\n status: status\n }, additionalOptions)\n };\n var query = this.shouldUseLegacyQRCodeMutation ? queries_1.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY : queries_1.UPDATE_PAYMENT_CONTEXT_QUERY;\n return this.apiRequest(query, data).then(function () {\n // noop so we can resolve without any data to match the type\n });\n };\n VenmoDesktop.prototype.lookupVenmoDesktopPaymentContext = function () {\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n var query = this.shouldUseLegacyQRCodeMutation ? queries_1.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY : queries_1.VENMO_PAYMENT_CONTEXT_STATUS_QUERY;\n return this.apiRequest(query, {\n id: this.venmoContextId\n }).then(function (response) {\n return response.node;\n });\n };\n return VenmoDesktop;\n }();\n exports.default = VenmoDesktop;\n }, {\n \"../shared/events\": 220,\n \"./queries\": 214,\n \"@braintree/iframer\": 35,\n \"@braintree/uuid\": 39,\n \"framebus\": 52\n }],\n 216: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /** @module braintree-web/venmo */\n var analytics = _dereq_(\"../lib/analytics\");\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var errors = _dereq_(\"./shared/errors\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var Venmo = _dereq_(\"./venmo\");\n var supportsVenmo = _dereq_(\"./shared/supports-venmo\");\n var VERSION = \"3.101.1\";\n\n /**\n * @typedef {object} Venmo~lineItem\n * @property {number} quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} name Item name. Maximum 127 characters.\n * @property {string} kind Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.\n * @property {?string} unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {?string} description Item description. Maximum 127 characters.\n * @property {?string} productCode Product or UPC code for the item. Maximum 127 characters.\n * @property {?string} url The URL to product information.\n */\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that support returning from the Venmo app to the same tab.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that are not webviews.\n * @param {boolean} [options.ignoreHistoryChanges=false] When the Venmo app returns to the website, it will modify the hash of the url to include data about the tokenization. By default, the SDK will put the state of the hash back to where it was before the change was made. Pass `true` to handle the hash change instead of the SDK.\n * @param {string} [options.profileId] The Venmo profile ID to be used during payment authorization. Customers will see the business name and logo associated with this Venmo profile, and it will show up in the Venmo app as a \"Connected Merchant\". Venmo profile IDs can be found in the Braintree Control Panel. Omitting this value will use the default Venmo profile.\n * @param {string} [options.deepLinkReturnUrl] An override for the URL that the Venmo iOS app opens to return from an app switch.\n * @param {boolean} [options.requireManualReturn=false] When `true`, the customer will have to manually switch back to the browser/webview that is presenting Venmo to complete the payment.\n * @param {boolean} [options.useRedirectForIOS=false] Normally, the Venmo flow is launched using `window.open` and the Venmo app intercepts that call and opens the Venmo app instead. If the customer does not have the Venmo app installed, it opens the Venmo website in a new window and instructs the customer to install the app.\n \n * In iOS webviews and Safari View Controllers (a webview-like environment which is indistinguishable from Safari for JavaScript environments), this call to `window.open` will always fail to app switch to Venmo, resulting instead in a white screen. Because of this, an alternate approach is required to launch the Venmo flow.\n *\n * When `useRedirectForIOS` is `true` and the Venmo flow is started in an iOS environment, the Venmo flow will be started by setting `window.location.href` to the Venmo website (which will still be intercepted by the Venmo app and should be the same behavior as if `window.open` was called). However, if the customer does not have the Venmo app installed, the merchant page will instead be replaced with the Venmo website and the customer will need to use the browser's back button to return to the merchant's website. Ensure that your customer's checkout information will not be lost if they are navigated away from the website and return using the browser back button.\n *\n * Due to a bug in iOS's implementation of `window.open` in iOS webviews and Safari View Controllers, if `useRedirectForIOS` is not set to `true` and the flow is launched from an iOS webview or Safari View Controller, the customer will be presented with a blank screen, halting the flow and leaving the customer unable to return to the merchant's website. Setting `useRedirectForIOS` to `true` will allow the flow to continue, but the Venmo app will be unable to return back to the webview/Safari View Controller. It will instead open the merchant's site in a new window in the customer's browser, which means the merchant site must be able to process the Venmo payment. If the SDK is configured with `allowNewBrowserTab = false`, it is unlikely that the website is set up to process the Venmo payment from a new window.\n *\n * If processing the payment from a new window is not possible, use this flag in conjunction with `requireManualReturn` so that the customer may start the flow from a webview/Safari View Controller or their Safari browser and manually return to the place that originated the flow once the Venmo app has authorized the payment and instructed them to do so.\n * @param {string} [options.paymentMethodUsage] The intended usage for the Venmo payment method nonce. Possible options are:\n * * single_use - intended as a one time transaction\n * * multi_use - intended to be vaulted and used for multiple transactions\n * @param {string} [options.displayName] The business name that will be displayed in the Venmo app payment approval screen. Only applicable when used with `paymentMethodUsage` and used by merchants onboarded as PayFast channel partners.\n * @param {boolean} [options.allowDesktop] Used to support desktop users. When enabled, the default mode is to render a scannable QR-code customers scan with their phone's to approve via the mobile app.\n * @param {boolean} [options.allowDesktopWebLogin=false] When `true`, the customer will authorize payment via a window popup that allows them to sign in to their Venmo account. This is used explicitly for customers operating from desktop browsers wanting to avoid the QR Code flow.\n * @param {boolean} [options.mobileWebFallBack] Use this option when you want to use a web-login experience, such as if on mobile and the Venmo app isn't installed.\n * @param {boolean} [options.allowAndroidRecreation=true] This flag is for when your integration uses the [Android PopupBridge](https://github.com/braintree/popup-bridge-android). Setting this flag to false will avoid a page refresh when returning to your page after payment authorization. If not specified, it defaults to true and the Android activity will be recreated, resulting in a page refresh.\n * @param {boolean} [options.collectCustomerBillingAddress] When `true`, the customer's billing address will be collected and displayed on the Venmo paysheet (provided the Enriched Customer Data checkbox is also enabled for the merchant account).\n * @param {boolean} [options.collectCustomerShippingAddress] When `true`, the customer's shipping address will be collected and displayed on the Venmo paysheet (provided the Enriched Customer Data checkbox is also enabled for the merchant account).\n * @param {boolean} [options.isFinalAmount=false] When `true`, it denotes that the purchase amount (`totalAmount`) is final and will not change.\n * @param {lineItem[]} [options.lineItems] The {@link Venmo~lineItem|line items} belonging to the transaction. It can include up to 249 line items.\n * @param {string} [options.subTotalAmount] The subtotal amount of the transaction, excluding taxes, discounts, and shipping.\n * @param {string} [options.discountAmount] The total discount amount applied on the transaction.\n * @param {string} [options.shippingAmount] Shipping amount to be charged for the transaction.\n * @param {string} [options.taxAmount] The total tax amount applied to the transaction. This value can't be negative or zero.\n * @param {string} [options.totalAmount] The grand total amount of the transaction.\n *\n * Note: This flow currently requires a full page redirect, which means to utilize this flow your page will need to be able to handle the checkout session across different pages.\n * @param {callback} [callback] The second argument, `data`, is the {@link Venmo} instance. If no callback is provided, `create` returns a promise that resolves with the {@link Venmo} instance.\n * @example\n * braintree.venmo.create({\n * client: clientInstance\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @example Allow desktop flow to be used\n * braintree.venmo.create({\n * client: clientInstance,\n * allowDesktop: true\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @returns {(Promise|void)} Returns the Venmo instance.\n */\n function create(options) {\n var name = \"Venmo\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n var createPromise, instance;\n if (options.profileId && typeof options.profileId !== \"string\") {\n return Promise.reject(new BraintreeError(errors.VENMO_INVALID_PROFILE_ID));\n }\n if (options.deepLinkReturnUrl && typeof options.deepLinkReturnUrl !== \"string\") {\n return Promise.reject(new BraintreeError(errors.VENMO_INVALID_DEEP_LINK_RETURN_URL));\n }\n createPromise = createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n }).then(function (client) {\n var configuration = client.getConfiguration();\n options.client = client;\n if (!configuration.gatewayConfiguration.payWithVenmo) {\n return Promise.reject(new BraintreeError(errors.VENMO_NOT_ENABLED));\n }\n return client;\n });\n options.createPromise = createPromise;\n instance = new Venmo(options);\n analytics.sendEvent(createPromise, \"venmo.initialized\");\n return createPromise.then(function () {\n return instance;\n });\n });\n }\n\n /**\n * @static\n * @function isBrowserSupported\n * @param {object} [options] browser support options:\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control.\n * @example\n * if (braintree.venmo.isBrowserSupported()) {\n * // set up Venmo\n * }\n * @example Explicitly require browser support returning to the same tab\n * if (braintree.venmo.isBrowserSupported({\n * allowNewBrowserTab: false\n * })) {\n * // set up Venmo\n * }\n * @example Explicitly set webviews as disallowed browsers\n * if (braintree.venmo.isBrowserSupported({\n * allowWebviews: false\n * })) {\n * // set up Venmo\n * }\n * @returns {boolean} Whether or not the browser supports Venmo.\n */\n function isBrowserSupported(options) {\n return supportsVenmo.isBrowserSupported(options);\n }\n module.exports = {\n create: wrapPromise(create),\n isBrowserSupported: isBrowserSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./shared/errors\": 219,\n \"./shared/supports-venmo\": 222,\n \"./venmo\": 224,\n \"@braintree/wrap-promise\": 43\n }],\n 217: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var isAndroid = _dereq_(\"@braintree/browser-detection/is-android\");\n var isChrome = _dereq_(\"@braintree/browser-detection/is-chrome\");\n var isIos = _dereq_(\"@braintree/browser-detection/is-ios\");\n var isIosSafari = _dereq_(\"@braintree/browser-detection/is-ios-safari\");\n var isIosWebview = _dereq_(\"@braintree/browser-detection/is-ios-webview\");\n var isSamsung = _dereq_(\"@braintree/browser-detection/is-samsung\");\n function isAndroidWebview() {\n return isAndroid() && window.navigator.userAgent.toLowerCase().indexOf(\"wv\") > -1;\n }\n function doesNotSupportWindowOpenInIos() {\n if (!isIos()) {\n return false;\n }\n return isIosWebview() || !isIosSafari();\n }\n function isFacebookOwnedBrowserOnAndroid() {\n var ua = window.navigator.userAgent.toLowerCase();\n\n // Huawei's Facebook useragent does not include Android\n if (ua.indexOf(\"huawei\") > -1 && ua.indexOf(\"fban\") > -1) {\n return true;\n }\n if (!isAndroid()) {\n return false;\n }\n return ua.indexOf(\"fb_iab\") > -1 || ua.indexOf(\"instagram\") > -1;\n }\n function isIosChrome() {\n return isIos() && isChrome();\n }\n module.exports = {\n isAndroid: isAndroid,\n isAndroidWebview: isAndroidWebview,\n isChrome: isChrome,\n isIos: isIos,\n isIosChrome: isIosChrome,\n isSamsung: isSamsung,\n isIosSafari: isIosSafari,\n isIosWebview: isIosWebview,\n isFacebookOwnedBrowserOnAndroid: isFacebookOwnedBrowserOnAndroid,\n doesNotSupportWindowOpenInIos: doesNotSupportWindowOpenInIos\n };\n }, {\n \"@braintree/browser-detection/is-android\": 22,\n \"@braintree/browser-detection/is-chrome\": 24,\n \"@braintree/browser-detection/is-ios\": 30,\n \"@braintree/browser-detection/is-ios-safari\": 27,\n \"@braintree/browser-detection/is-ios-webview\": 28,\n \"@braintree/browser-detection/is-samsung\": 31\n }],\n 218: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * Venmo shared constants\n * @typedef {object} Venmo~venmoConstants\n * @ignore\n * @property {string} VENMO_APP_OR_MOBILE_AUTH_URL A deep-linked url that will open the Venmo app if installed, or navigate to a Venmo web-login experience if the Venmo app is not present.\n * @property {string} VENMO_MOBILE_APP_AUTH_ONLY_URL A deep-linked url that leads to a Venmo dead-end page if the Venmo app is not installed (page asks customer to download the app).\n * @property {string} VENMO_WEB_LOGIN_URL A non-deeplinked url that leads to a Venmo login page. For use when explicitly wanting to avoid using the Venmo mobile app via a deep-linked url.\n */\n module.exports = {\n DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY: 500,\n DEFAULT_PROCESS_RESULTS_DELAY: 1000,\n VENMO_APP_OR_MOBILE_AUTH_URL: \"https://venmo.com/go/checkout\",\n VENMO_MOBILE_APP_AUTH_ONLY_URL: \"https://venmo.com/braintree/checkout\",\n VENMO_WEB_LOGIN_URL: \"https://account.venmo.com/go/web\"\n };\n }, {}],\n 219: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Venmo - Creation Error Codes\n * @description Errors that occur when [creating the Venmo component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VENMO_NOT_ENABLED Occurs when Venmo is not enabled on the Braintree control panel.\n * @property {MERCHANT} VENMO_INVALID_PROFILE_ID Occurs when Venmo is initialized with a profile id, but it is invalid.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_SETUP_FAILED __Deprecated__ No longer returned. Use `VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED` instead.\n * @property {UNKNOWN} VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED Occurs when the request to set up a Venmo Payment Context object fails.\n */\n\n /**\n * @name BraintreeError.Venmo - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./Venmo.html#tokenize).\n * @property {CUSTOMER} VENMO_APP_CANCELED Occurs when customer cancels flow from the Venmo app.\n * @property {UNKNOWN} VENMO_APP_FAILED Occurs when tokenization fails.\n * @property {CUSTOMER} VENMO_CANCELED Occurs when customer cancels the flow or Venmo app is not available.\n * @property {CUSTOMER} VENMO_CUSTOMER_CANCELED Occurs when customer cancels the flow.\n * @property {CUSTOMER} VENMO_DESKTOP_CANCELED Occurs when customer cancels the Venmo Desktop flow by closing the modal.\n * @property {UNKNOWN} VENMO_DESKTOP_UNKNOWN_ERROR Occurs when an unknown error causes the Venmo Desktop flow to fail.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR Occurs when an unknown network error causes the mobile polling process to fail.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED Occurs when the polling has expired and the payment cannot be completed.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED Occurs when the polling operation is canceled by the customer.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT Occurs when customer takes too long to complete payment.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_FAILED Occurs if there is an unknown error during the mobile polling process.\n * @property {NETWORK} VENMO_NETWORK_ERROR Occurs when a network error causes a request to fail.\n * @property {MERCHANT} VENMO_TOKENIZATION_CANCELED_BY_MERCHANT Occurs when `cancelTokenization` is called while tokenization is in progress.\n * @property {UNKNOWN} VENMO_TOKENIZATION_FAILED Occurs when there is an unknown error during the web login experience.\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_ACTIVE Occurs when `tokenize` is called when the flow is already in progress.\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE Occurs when `cancelTokenization` is called when the flow is not in progress.\n * @property {MERCHANT} VENMO_ECD_DISABLED Occurs when the merchant tries to access customer details without enabling Enriched Customer Data.\n */\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n module.exports = {\n VENMO_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_NOT_ENABLED\",\n message: \"Venmo is not enabled for this merchant.\"\n },\n VENMO_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_REQUEST_ACTIVE\",\n message: \"Another tokenization request is active.\"\n },\n VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE\",\n message: \"No tokenization in progress.\"\n },\n VENMO_APP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_APP_FAILED\",\n message: \"Venmo app encountered a problem.\"\n },\n VENMO_APP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_APP_CANCELED\",\n message: \"Venmo app authorization was canceled.\"\n },\n VENMO_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_CANCELED\",\n message: \"User canceled Venmo authorization, or Venmo app is not available.\"\n },\n VENMO_CUSTOMER_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_CUSTOMER_CANCELED\",\n message: \"User canceled Venmo authorization.\"\n },\n VENMO_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"VENMO_NETWORK_ERROR\",\n message: \"Something went wrong making the request\"\n },\n VENMO_DESKTOP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_DESKTOP_CANCELED\",\n message: \"User canceled Venmo authorization by closing the Venmo Desktop modal.\"\n },\n VENMO_TOKENIZATION_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_CANCELED_BY_MERCHANT\",\n message: \"The Venmo tokenization was canceled by the merchant.\"\n },\n VENMO_DESKTOP_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_DESKTOP_UNKNOWN_ERROR\",\n message: \"Something went wrong with the Venmo Desktop flow.\"\n },\n VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED\",\n message: \"Something went wrong creating the Venmo Payment Context.\"\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR\",\n message: \"Something went wrong during mobile polling.\"\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED\",\n message: \"The Venmo authorization request is expired.\"\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED\",\n message: \"The Venmo authorization was canceled\"\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT\",\n message: \"Customer took too long to authorize Venmo payment.\"\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_FAILED\",\n message: \"The Venmo authorization failed.\"\n },\n VENMO_INVALID_PROFILE_ID: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_INVALID_PROFILE_ID\",\n message: \"Venmo profile ID is invalid.\"\n },\n VENMO_INVALID_DEEP_LINK_RETURN_URL: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_INVALID_DEEP_LINK_RETURN_URL\",\n message: \"Venmo deep link return URL is invalid.\"\n },\n VENMO_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_TOKENIZATION_FAILED\",\n message: \"Venmo encountered a problem\"\n },\n VENMO_ECD_DISABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"ECD_DISABLED\",\n message: \"Cannot collect customer data when ECD is disabled. Enable this feature in the Control Panel to collect this data.\"\n }\n };\n }, {\n \"../../lib/braintree-error\": 124\n }],\n 220: [function (_dereq_, module, exports) {\n \"use strict\";\n\n Object.defineProperty(exports, \"__esModule\", {\n value: true\n });\n exports.VENMO_DESKTOP_UNKNOWN_ERROR = exports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE = exports.VENMO_DESKTOP_CLOSED_FROM_PARENT = exports.VENMO_DESKTOP_IFRAME_READY = exports.VENMO_DESKTOP_DISPLAY_QR_CODE = exports.VENMO_DESKTOP_DISPLAY_ERROR = exports.VENMO_DESKTOP_CUSTOMER_CANCELED = exports.VENMO_DESKTOP_AUTHORIZING = exports.VENMO_DESKTOP_AUTHORIZE = exports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT = void 0;\n exports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT = \"VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT\";\n exports.VENMO_DESKTOP_AUTHORIZE = \"VENMO_DESKTOP_AUTHORIZE\";\n exports.VENMO_DESKTOP_AUTHORIZING = \"VENMO_DESKTOP_AUTHORIZING\";\n exports.VENMO_DESKTOP_CUSTOMER_CANCELED = \"VENMO_DESKTOP_CUSTOMER_CANCELED\";\n exports.VENMO_DESKTOP_DISPLAY_ERROR = \"VENMO_DESKTOP_DISPLAY_ERROR\";\n exports.VENMO_DESKTOP_DISPLAY_QR_CODE = \"VENMO_DESKTOP_DISPLAY_QR_CODE\";\n exports.VENMO_DESKTOP_IFRAME_READY = \"VENMO_DESKTOP_IFRAME_READY\";\n exports.VENMO_DESKTOP_CLOSED_FROM_PARENT = \"VENMO_DESKTOP_CLOSED_FROM_PARENT\";\n exports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE = \"VENMO_DESKTOP_REQUEST_NEW_QR_CODE\";\n exports.VENMO_DESKTOP_UNKNOWN_ERROR = \"VENMO_DESKTOP_UNKNOWN_ERROR\";\n }, {}],\n 221: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var venmoConstants = _dereq_(\"./constants\");\n function getVenmoUrl(options) {\n if (options.useAllowDesktopWebLogin) return venmoConstants.VENMO_WEB_LOGIN_URL;\n if (options.mobileWebFallBack) return venmoConstants.VENMO_APP_OR_MOBILE_AUTH_URL;\n return venmoConstants.VENMO_MOBILE_APP_AUTH_ONLY_URL;\n }\n module.exports = getVenmoUrl;\n }, {\n \"./constants\": 218\n }],\n 222: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var browserDetection = _dereq_(\"./browser-detection\");\n var inIframe = _dereq_(\"../../lib/in-iframe\");\n function isBrowserSupported(options) {\n var isKnownUnsupportedMobileBrowser, merchantAllowsDesktopBrowsers, merchantAllowsIosChrome, merchantAllowsReturningToNewBrowserTab, merchantAllowsWebviews;\n var isAndroid = browserDetection.isAndroid();\n var isMobileDevice = isAndroid || browserDetection.isIos();\n var isAndroidChrome = isAndroid && browserDetection.isChrome();\n var isMobileDeviceThatSupportsReturnToSameTab = browserDetection.isIosSafari() || isAndroidChrome;\n options = options || {};\n // NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out\n merchantAllowsDesktopBrowsers = (options.allowDesktopWebLogin || options.allowDesktop) === true;\n merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty(\"allowNewBrowserTab\") ? options.allowNewBrowserTab : true;\n // NEXT_MAJOR_VERSION webviews are not supported, except for the case where\n // the merchant themselves is presenting venmo in a webview using the deep\n // link url to get back to their app. For the next major version, we should\n // just not have this option and instead require the merchant to determine\n // if the venmo button should be displayed when presenting it in the\n // merchant's app via a webview.\n merchantAllowsWebviews = options.hasOwnProperty(\"allowWebviews\") ? options.allowWebviews : true;\n // Venmo only works on iOS Chrome when the\n // button is not rendered in an iFrame and\n // allowNewBrowserTab is set to true\n merchantAllowsIosChrome = merchantAllowsReturningToNewBrowserTab && !inIframe();\n isKnownUnsupportedMobileBrowser = !merchantAllowsIosChrome && browserDetection.isIosChrome() || browserDetection.isFacebookOwnedBrowserOnAndroid() || browserDetection.isSamsung();\n if (isKnownUnsupportedMobileBrowser) {\n return false;\n }\n if (!merchantAllowsWebviews && (browserDetection.isAndroidWebview() || browserDetection.isIosWebview())) {\n return false;\n }\n if (!isMobileDevice) {\n return merchantAllowsDesktopBrowsers;\n }\n if (!merchantAllowsReturningToNewBrowserTab) {\n return isMobileDeviceThatSupportsReturnToSameTab;\n }\n return isMobileDevice;\n }\n module.exports = {\n isBrowserSupported: isBrowserSupported\n };\n }, {\n \"../../lib/in-iframe\": 150,\n \"./browser-detection\": 217\n }],\n 223: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var frameService = _dereq_(\"../../lib/frame-service/external\");\n var useMin = _dereq_(\"../../lib/use-min\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var errors = _dereq_(\"../shared/errors\");\n var BraintreeError = _dereq_(\"../../lib/braintree-error\");\n var VERSION = \"3.101.1\";\n var VENMO_LOGO_SVG = '\\n \\n \\n \\n \\n \\n';\n var CONTINUE_OR_CANCEL_INSTRUCTIONS = \"Tap cancel payment to cancel and return to the business. Continue payment will relaunch the payment window.\";\n var POPUP_WIDTH = 400;\n var POPUP_HEIGHT = 570;\n var ELEMENT_IDS = {\n backdrop: \"venmo-desktop-web-backdrop\",\n backdropHidden: \"venmo-desktop-web-backdrop.hidden\",\n backdropContainer: \"venmo-backdrop-container\",\n cancelButton: \"venmo-popup-cancel-button\",\n continueButton: \"venmo-popup-continue-button\",\n message: \"venmo-message\",\n instructions: \"venmo-instructions\",\n venmoLogo: \"venmo-full-logo\"\n };\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n function openPopup(options) {\n var frameServiceInstance = options.frameServiceInstance;\n var venmoUrl = options.venmoUrl;\n var checkForStatusChange = options.checkForStatusChange;\n var cancelTokenization = options.cancelTokenization;\n var checkPaymentContextStatus = options.checkPaymentContextStatus;\n var extendedPromise = new ExtendedPromise();\n document.getElementById(ELEMENT_IDS.continueButton).addEventListener(\"click\", function () {\n frameServiceInstance.focus();\n });\n document.getElementById(ELEMENT_IDS.cancelButton).addEventListener(\"click\", function () {\n frameServiceInstance.close();\n cancelTokenization();\n closeBackdrop();\n });\n frameServiceInstance.open({}, function (frameServiceErr) {\n var retryStartingCount = 1;\n if (frameServiceErr) {\n extendedPromise.reject(frameServiceErr);\n } else {\n checkForStatusChange(retryStartingCount).then(function (data) {\n extendedPromise.resolve(data);\n }).catch(function (statusCheckError) {\n // We add this check here because at this point\n // the status should not be in CREATED status.\n // However, there is an edge case where if a buyer\n // cancels in the popup, the popup might close itself\n // before it can send the graphQL mutation to update its status.\n // In these cases, the status will be stuck in CREATED status, and\n // tokenization would fail, incorrectly throwing a tokenization error\n // instead of informing the merchant that the customer canceled.\n checkPaymentContextStatus().then(function (node) {\n if (node.status === \"CREATED\") {\n extendedPromise.reject(new BraintreeError(errors.VENMO_CUSTOMER_CANCELED));\n } else {\n extendedPromise.reject(statusCheckError);\n }\n });\n });\n }\n frameServiceInstance.close();\n closeBackdrop();\n });\n frameServiceInstance.redirect(venmoUrl);\n return extendedPromise;\n }\n function centeredPopupDimensions() {\n var popupTop = Math.round((window.outerHeight - POPUP_HEIGHT) / 2) + window.screenTop;\n var popupLeft = Math.round((window.outerWidth - POPUP_WIDTH) / 2) + window.screenLeft;\n return {\n top: popupTop,\n left: popupLeft\n };\n }\n function closeBackdrop() {\n document.getElementById(\"venmo-desktop-web-backdrop\").classList.add(\"hidden\");\n }\n function getElementStyles() {\n var backdropStyles = [\"#\" + ELEMENT_IDS.backdropHidden + \" {\", \"display: none;\", \"}\", \"#\" + ELEMENT_IDS.backdrop + \" {\", \"z-index: 3141592632;\", \"cursor: pointer;\", \"position: fixed;\", \"top: 0;\", \"left: 0;\", \"bottom: 0;\", \"width: 100%;\", \"background: rgba(0, 0, 0, 0.8);\", \"}\"];\n var backdropContainerStyles = [\"#\" + ELEMENT_IDS.backdropContainer + \" {\", \"display: flex;\", \"align-content: center;\", \"justify-content: center;\", \"align-items: center;\", \"width: 100%;\", \"height: 100%;\", \"flex-direction: column;\", \"}\"];\n var cancelButtonStyles = [\"#\" + ELEMENT_IDS.cancelButton + \" {\", \"height: 24px;\", \"width: 380px;\", \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\", \"font-style: normal;\", \"font-weight: 700;\", \"font-size: 18px;\", \"line-height: 24px;\", \"text-align: center;\", \"background-color: transparent;\", \"border: none;\", \"color: #FFFFFF;\", \"margin-top: 28px;\", \"}\"];\n var continueButtonStyles = [\"#\" + ELEMENT_IDS.continueButton + \" {\", \"width: 400px;\", \"height: 50px;\", \"background: #0074DE;\", \"border-radius: 24px;\", \"border: none;\", \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\", \"font-style: normal;\", \"font-weight: 700;\", \"font-size: 18px;\", \"color: #FFFFFF;\", \"margin-top: 44px;\", \"}\"];\n var messageStyles = [\"#\" + ELEMENT_IDS.message + \" {\", \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\", \"font-style: normal;\", \"font-weight: 500;\", \"font-size: 24px;\", \"line-height: 32px;\", \"text-align: center;\", \"color: #FFFFFF;\", \"margin-top: 32px;\", \"}\"];\n var instructionStyles = [\"#\" + ELEMENT_IDS.instructions + \" {\", \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\", \"font-style: normal;\", \"font-weight: 400;\", \"font-size: 16px;\", \"line-height: 20px;\", \"text-align: center;\", \"color: #FFFFFF;\", \"margin-top: 16px;\", \"width: 400px;\", \"}\"];\n var allStyles = backdropStyles.concat(backdropContainerStyles, cancelButtonStyles, continueButtonStyles, messageStyles, instructionStyles);\n return allStyles.join(\"\\n\");\n }\n function buildAndStyleElements() {\n var alreadyRenderedBackdrop = document.getElementById(ELEMENT_IDS.backdrop);\n var backdropStylesElement, backdropDiv, backDropContentContainer, venmoLogoDiv, venmoMessageDiv, instructionsDiv, continueButton, cancelButton;\n if (alreadyRenderedBackdrop) {\n alreadyRenderedBackdrop.classList.remove(\"hidden\");\n return;\n }\n backdropStylesElement = document.createElement(\"style\");\n backdropDiv = document.createElement(\"div\");\n backDropContentContainer = document.createElement(\"div\");\n venmoLogoDiv = document.createElement(\"div\");\n venmoMessageDiv = document.createElement(\"div\");\n instructionsDiv = document.createElement(\"div\");\n continueButton = document.createElement(\"button\");\n cancelButton = document.createElement(\"button\");\n backdropStylesElement.id = \"venmo-desktop-web__injected-styles\";\n backdropStylesElement.innerHTML = getElementStyles();\n backdropDiv.id = ELEMENT_IDS.backdrop;\n backDropContentContainer.id = ELEMENT_IDS.backdropContainer;\n venmoLogoDiv.id = ELEMENT_IDS.venmoLogo;\n venmoLogoDiv.innerHTML = VENMO_LOGO_SVG;\n venmoMessageDiv.id = ELEMENT_IDS.message;\n venmoMessageDiv.innerText = \"What would you like to do?\";\n instructionsDiv.id = ELEMENT_IDS.instructions;\n instructionsDiv.innerText = CONTINUE_OR_CANCEL_INSTRUCTIONS;\n continueButton.id = ELEMENT_IDS.continueButton;\n continueButton.innerText = \"Continue payment\";\n cancelButton.id = ELEMENT_IDS.cancelButton;\n cancelButton.innerText = \"Cancel payment\";\n document.head.appendChild(backdropStylesElement);\n backDropContentContainer.appendChild(venmoLogoDiv);\n backDropContentContainer.appendChild(venmoMessageDiv);\n backDropContentContainer.appendChild(instructionsDiv);\n backDropContentContainer.appendChild(continueButton);\n backDropContentContainer.appendChild(cancelButton);\n backdropDiv.appendChild(backDropContentContainer);\n document.body.appendChild(backdropDiv);\n backdropDiv.addEventListener(\"click\", function (event) {\n event.stopPropagation();\n });\n }\n\n /**\n * Applies a backdrop over the page, and opens a popup to the supplied url. Uses supplied status and cancel functions to handle the flow.\n * @function runWebLogin\n * @ignore\n * @param {object} options Options for running the web login flow.\n * @param {string} options.venmoUrl Venmo url that is to be used for logging in.\n * @param {Venmo~checkPaymentContextStatusAndProcessResult} options.checkForStatusChange {@link Venmo~checkPaymentContextStatusAndProcessResult} to be invoked in order to check for a payment context status update.\n * @param {Venmo~cancelTokenization} options.cancelTokenization {@link Venmo~cancelTokenization} to be invoked when the appropriate payment context status is retrieved.\n * @param {boolean} options.debug A flag to control whether to use minified assets or not.\n * @returns {Promise} Returns a promise\n */\n function runWebLogin(options) {\n buildAndStyleElements();\n return openPopup(options);\n }\n\n /**\n * When using frameservice, it needs to be created separately from the action of opening. The setup process includes\n * steps that browsers may consider async or too disconnected from the user action required to open a popup.\n *\n * This function enables us to do that setup at an appropriate time.\n * @function setupDesktopWebLogin\n * @ignore\n * @param {object} options Options use for setting up the Desktop Web Login flow.\n * @param {string} options.assetsUrl Url that points to the hosted Braintree assets.\n * @param {boolean} options.debug A flag to control whether to use minified assets or not.\n \n * @returns {Promise} Returns a promise\n */\n function setupDesktopWebLogin(options) {\n var extendedPromise = new ExtendedPromise();\n var popupName = \"venmoDesktopWebLogin\";\n var assetsUrl = options.assetsUrl;\n var debug = options.debug || false;\n var popupLocation = centeredPopupDimensions();\n var assetsBaseUrl = assetsUrl + \"/web/\" + VERSION + \"/html\";\n frameService.create({\n name: popupName,\n dispatchFrameUrl: assetsBaseUrl + \"/dispatch-frame\" + useMin(debug) + \".html\",\n openFrameUrl: assetsBaseUrl + \"/venmo-landing-frame\" + useMin(debug) + \".html\",\n top: popupLocation.top,\n left: popupLocation.left,\n height: POPUP_HEIGHT,\n width: POPUP_WIDTH\n }, function (frameServiceInstance) {\n extendedPromise.resolve(frameServiceInstance);\n });\n return extendedPromise;\n }\n module.exports = {\n runWebLogin: runWebLogin,\n openPopup: openPopup,\n setupDesktopWebLogin: setupDesktopWebLogin,\n POPUP_WIDTH: POPUP_WIDTH,\n POPUP_HEIGHT: POPUP_HEIGHT\n };\n }, {\n \"../../lib/braintree-error\": 124,\n \"../../lib/frame-service/external\": 139,\n \"../../lib/use-min\": 160,\n \"../shared/errors\": 219,\n \"@braintree/extended-promise\": 34\n }],\n 224: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var analytics = _dereq_(\"../lib/analytics\");\n var isBrowserSupported = _dereq_(\"./shared/supports-venmo\");\n var browserDetection = _dereq_(\"./shared/browser-detection\");\n var constants = _dereq_(\"./shared/constants\");\n var errors = _dereq_(\"./shared/errors\");\n var querystring = _dereq_(\"../lib/querystring\");\n var isVerifiedDomain = _dereq_(\"../lib/is-verified-domain\");\n var methods = _dereq_(\"../lib/methods\");\n var convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var inIframe = _dereq_(\"../lib/in-iframe\");\n var ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n var getVenmoUrl = _dereq_(\"./shared/get-venmo-url\");\n var desktopWebLogin = _dereq_(\"./shared/web-login-backdrop\");\n var snakeCaseToCamelCase = _dereq_(\"../lib/snake-case-to-camel-case\");\n\n // NEXT_MAJOR_VERSION the source code for this is actually in a\n // typescript repo called venmo-desktop, once the SDK is migrated\n // to typescript, we can move the TS files out of that separate\n // repo and into the web SDK properly\n var createVenmoDesktop = _dereq_(\"./external/\");\n var graphqlQueries = _dereq_(\"./external/queries\");\n var VERSION = \"3.101.1\";\n var DEFAULT_MOBILE_POLLING_INTERVAL = 250; // 1/4 second\n var DEFAULT_MOBILE_EXPIRING_THRESHOLD = 300000; // 5 minutes\n\n ExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n /**\n * Venmo tokenize payload.\n * @typedef {object} Venmo~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `VenmoAccount`.\n * @property {object} details Additional Venmo account details.\n * @property {string} details.username The username of the Venmo account.\n * @property {string} details.paymentContextId The context ID of the Venmo payment. Only available when used with {@link https://braintree.github.io/braintree-web/current/module-braintree-web_venmo.html#.create|`paymentMethodUsage`}.\n */\n\n /**\n * @class\n * @param {object} options The Venmo {@link module:braintree-web/venmo.create create} options.\n * @description Do not use this constructor directly. Use {@link module:braintree-web/venmo.create|braintree-web.venmo.create} instead.\n * @classdesc This class represents a Venmo component produced by {@link module:braintree-web/venmo.create|braintree-web/venmo.create}. Instances of this class have methods for tokenizing Venmo payments.\n */\n function Venmo(options) {\n var self = this;\n this._allowDesktopWebLogin = options.allowDesktopWebLogin || false;\n this._mobileWebFallBack = options.mobileWebFallBack || false;\n this._createPromise = options.createPromise;\n this._allowNewBrowserTab = options.allowNewBrowserTab !== false;\n this._allowWebviews = options.allowWebviews !== false;\n this._allowDesktop = options.allowDesktop === true;\n this._useRedirectForIOS = options.useRedirectForIOS === true;\n this._profileId = options.profileId;\n this._displayName = options.displayName;\n this._deepLinkReturnUrl = options.deepLinkReturnUrl;\n this._ignoreHistoryChanges = options.ignoreHistoryChanges;\n this._paymentMethodUsage = (options.paymentMethodUsage || \"\").toUpperCase();\n this._shouldUseLegacyFlow = !this._paymentMethodUsage;\n this._requireManualReturn = options.requireManualReturn === true;\n this._useDesktopQRFlow = this._allowDesktop && this._isDesktop() && !this._allowDesktopWebLogin;\n this._useAllowDesktopWebLogin = this._allowDesktopWebLogin && this._isDesktop();\n this._cannotHaveReturnUrls = inIframe() || this._requireManualReturn;\n this._allowAndroidRecreation = options.allowAndroidRecreation !== false;\n this._maxRetryCount = 3;\n this._collectCustomerBillingAddress = options.collectCustomerBillingAddress || false;\n this._collectCustomerShippingAddress = options.collectCustomerShippingAddress || false;\n this._isFinalAmount = options.isFinalAmount || false;\n this._lineItems = options.lineItems;\n this._subTotalAmount = options.subTotalAmount;\n this._discountAmount = options.discountAmount;\n this._taxAmount = options.taxAmount;\n this._shippingAmount = options.shippingAmount;\n this._totalAmount = options.totalAmount;\n this._shouldCreateVenmoPaymentContext = this._cannotHaveReturnUrls || !this._shouldUseLegacyFlow;\n analytics.sendEvent(this._createPromise, \"venmo.desktop-flow.configured.\" + String(Boolean(this._allowDesktop)));\n\n // if the url has a tokenization result, that indicates\n // that it cannot be the desktop flow or the manual return\n // flow. If it's the hash change with paymentMethodUsage\n // flow, we want to skip creating a new payment context, since\n // there is already a pending payment context waiting to be\n // processed. For the hash change flow without paymentMethodUsage,\n // no further actions are needed.\n if (this.hasTokenizationResult()) {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.return-in-new-tab\");\n } else if (this._useDesktopQRFlow) {\n this._createPromise = this._createPromise.then(function (client) {\n var config = client.getConfiguration().gatewayConfiguration;\n return createVenmoDesktop({\n url: config.assetsUrl + \"/web/\" + VERSION + \"/html/venmo-desktop-frame.html\",\n environment: config.environment === \"production\" ? \"PRODUCTION\" : \"SANDBOX\",\n profileId: self._profileId || config.payWithVenmo.merchantId,\n paymentMethodUsage: self._paymentMethodUsage,\n displayName: self._displayName,\n Promise: Promise,\n apiRequest: function (query, data) {\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: data\n }\n }).then(function (response) {\n return response.data;\n });\n },\n sendEvent: function (eventName) {\n analytics.sendEvent(self._createPromise, eventName);\n },\n verifyDomain: isVerifiedDomain\n }).then(function (venmoDesktopInstance) {\n self._venmoDesktopInstance = venmoDesktopInstance;\n analytics.sendEvent(self._createPromise, \"venmo.desktop-flow.presented\");\n return client;\n }).catch(function () {\n analytics.sendEvent(self._createPromise, \"venmo.desktop-flow.setup-failed\");\n self._useDesktopQRFlow = false;\n return client;\n });\n });\n } else if (this._shouldCreateVenmoPaymentContext) {\n // these variables are only relevant for the manual return flow\n // and they are only set to make testing easier (so they can\n // be overwritten with smaller values in the tests)\n this._mobilePollingInterval = DEFAULT_MOBILE_POLLING_INTERVAL;\n this._mobilePollingExpiresThreshold = DEFAULT_MOBILE_EXPIRING_THRESHOLD;\n this._createPromise = this._createPromise.then(function (client) {\n var paymentContextPromise, webLoginPromise;\n var analyticsCategory = self._cannotHaveReturnUrls ? \"manual-return\" : \"mobile-payment-context\";\n var config = client.getConfiguration();\n webLoginPromise = desktopWebLogin.setupDesktopWebLogin({\n assetsUrl: config.gatewayConfiguration.assetsUrl,\n debug: config.isDebug\n }).then(function (frameServiceInstance) {\n self._frameServiceInstance = frameServiceInstance;\n }).catch(function (desktopWebErr) {\n return desktopWebErr;\n });\n self._mobilePollingContextEnvironment = config.gatewayConfiguration.environment.toUpperCase();\n paymentContextPromise = self._createVenmoPaymentContext(client).then(function () {\n analytics.sendEvent(self._createPromise, \"venmo.\" + analyticsCategory + \".presented\");\n return client;\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, \"venmo.\" + analyticsCategory + \".setup-failed\");\n return Promise.reject(new BraintreeError({\n type: errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.type,\n code: errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.code,\n message: isValidationError(err) ? err.details.originalError[0].message : errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.message,\n details: {\n originalError: err\n }\n }));\n });\n return ExtendedPromise.all([webLoginPromise, paymentContextPromise]).then(function (results) {\n var paymentContextResult = results[1]; // We only care about the returned value of the paymentContextPromise\n\n return Promise.resolve(paymentContextResult);\n }).catch(function (promiseErr) {\n // ExtendedPromise.all returns just one error and it's either which fails first/at all.\n return Promise.reject(promiseErr);\n });\n });\n }\n }\n function isValidationError(err) {\n return err.details && err.details.originalError && err.details.originalError[0] && err.details.originalError[0].extensions && err.details.originalError[0].extensions.errorClass === \"VALIDATION\" && err.details.originalError[0].extensions.errorType === \"user_error\";\n }\n Venmo.prototype._createVenmoPaymentContext = function (client, cancelIfTokenizationInProgress) {\n var self = this;\n var promise, transactionDetails;\n var configuration = client.getConfiguration();\n var venmoConfiguration = configuration.gatewayConfiguration.payWithVenmo;\n var transactionDetailsPresent = false;\n var customerClientChannel = self._useAllowDesktopWebLogin ? \"WEB\" : \"MOBILE_WEB\";\n if (!this._shouldCreateVenmoPaymentContext) {\n return Promise.resolve();\n }\n if (this._shouldUseLegacyFlow) {\n promise = client.request({\n api: \"graphQLApi\",\n data: {\n query: graphqlQueries.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY,\n variables: {\n input: {\n environment: this._mobilePollingContextEnvironment,\n intent: \"PAY_FROM_APP\"\n }\n }\n }\n }).then(function (response) {\n return response.data.createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n });\n } else {\n // Merchants are not allowed to collect user addresses unless ECD (Enriched Customer Data) is enabled on the BT Control Panel.\n if ((this._collectCustomerBillingAddress || this._collectCustomerShippingAddress) && !venmoConfiguration.enrichedCustomerDataEnabled) {\n return Promise.reject(new BraintreeError(errors.VENMO_ECD_DISABLED));\n }\n if (this._lineItems) {\n this._lineItems.forEach(function (item) {\n item.unitTaxAmount = item.unitTaxAmount || \"0\";\n });\n }\n transactionDetails = {\n subTotalAmount: this._subTotalAmount,\n discountAmount: this._discountAmount,\n taxAmount: this._taxAmount,\n shippingAmount: this._shippingAmount,\n totalAmount: this._totalAmount,\n lineItems: this._lineItems\n };\n transactionDetailsPresent = Object.keys(transactionDetails).some(function (detail) {\n return transactionDetails[detail] !== undefined; // eslint-disable-line no-undefined\n });\n promise = client.request({\n api: \"graphQLApi\",\n data: {\n query: graphqlQueries.CREATE_PAYMENT_CONTEXT_QUERY,\n variables: {\n input: {\n paymentMethodUsage: this._paymentMethodUsage,\n intent: \"CONTINUE\",\n customerClient: customerClientChannel,\n isFinalAmount: this._isFinalAmount,\n displayName: this._displayName,\n paysheetDetails: {\n collectCustomerBillingAddress: this._collectCustomerBillingAddress,\n collectCustomerShippingAddress: this._collectCustomerShippingAddress,\n transactionDetails: transactionDetailsPresent ? transactionDetails : undefined // eslint-disable-line no-undefined\n }\n }\n }\n }\n }).then(function (response) {\n return response.data.createVenmoPaymentContext.venmoPaymentContext;\n });\n }\n return promise.then(function (context) {\n var expiredTime = new Date(context.expiresAt) - new Date(context.createdAt);\n var refreshIn = expiredTime * 0.6666;\n\n // prevents multiple setTimeouts from firing from separate calls\n // to create a payment context by canceling the previous one\n // if there is a pending call\n clearTimeout(self._refreshPaymentContextTimeout);\n self._refreshPaymentContextTimeout = setTimeout(function () {\n if (self._tokenizationInProgress) {\n return;\n }\n self._createVenmoPaymentContext(client, true);\n }, refreshIn);\n if (cancelIfTokenizationInProgress && self._tokenizationInProgress) {\n return;\n }\n self._venmoPaymentContextStatus = context.status;\n self._venmoPaymentContextId = context.id;\n });\n };\n Venmo.prototype.appSwitch = function (url) {\n if (this._deepLinkReturnUrl) {\n if (isIosWebviewInDeepLinkReturnUrlFlow()) {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.ios-webview\");\n // Deep link URLs do not launch iOS apps from a webview when using window.open or PopupBridge.open.\n window.location.href = url;\n } else if (window.popupBridge && typeof window.popupBridge.open === \"function\") {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.popup-bridge\");\n window.popupBridge.open(url);\n } else {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.webview\");\n window.open(url);\n }\n } else {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.browser\");\n if (browserDetection.doesNotSupportWindowOpenInIos() || this._shouldUseRedirectStrategy()) {\n window.location.href = url;\n } else {\n window.open(url);\n }\n }\n };\n Venmo.prototype.getUrl = function () {\n return this._createPromise.then(function (client) {\n var configuration = client.getConfiguration();\n var params = {};\n var currentUrl = this._deepLinkReturnUrl || window.location.href.replace(window.location.hash, \"\");\n var venmoConfiguration = configuration.gatewayConfiguration.payWithVenmo;\n var analyticsMetadata = configuration.analyticsMetadata;\n var accessToken = venmoConfiguration.accessToken;\n var braintreeData = {\n _meta: {\n version: analyticsMetadata.sdkVersion,\n integration: analyticsMetadata.integration,\n platform: analyticsMetadata.platform,\n sessionId: analyticsMetadata.sessionId\n }\n };\n this._isDebug = configuration.isDebug;\n this._assetsUrl = configuration.gatewayConfiguration.assetsUrl;\n currentUrl = currentUrl.replace(/#*$/, \"\");\n\n /* eslint-disable camelcase */\n if (this._venmoPaymentContextId) {\n if (this._shouldUseLegacyFlow) {\n // NEXT_MAJOR_VERSION stop adding the context id to the access token.\n // the context id is placed here for backwards compatiblity\n // with versions of the venmo app that did not support\n // pulling the resource id off of the query params\n accessToken += \"|pcid:\" + this._venmoPaymentContextId;\n } else {\n params.resource_id = this._venmoPaymentContextId;\n }\n }\n if (this._shouldIncludeReturnUrls() || this._useAllowDesktopWebLogin) {\n if (this._useAllowDesktopWebLogin) {\n currentUrl = this._assetsUrl + \"/web/\" + VERSION + \"/html/redirect-frame.html\";\n }\n params[\"x-success\"] = currentUrl + \"#venmoSuccess=1\";\n params[\"x-cancel\"] = currentUrl + \"#venmoCancel=1\";\n params[\"x-error\"] = currentUrl + \"#venmoError=1\";\n } else {\n params[\"x-success\"] = \"NOOP\";\n params[\"x-cancel\"] = \"NOOP\";\n params[\"x-error\"] = \"NOOP\";\n }\n if (!this._allowAndroidRecreation) {\n params.allowAndroidRecreation = 0;\n } else {\n params.allowAndroidRecreation = 1;\n }\n params.ua = window.navigator.userAgent;\n params.braintree_merchant_id = this._profileId || venmoConfiguration.merchantId;\n params.braintree_access_token = accessToken;\n params.braintree_environment = venmoConfiguration.environment;\n params.braintree_sdk_data = btoa(JSON.stringify(braintreeData));\n return getVenmoUrl({\n useAllowDesktopWebLogin: this._useAllowDesktopWebLogin,\n mobileWebFallBack: this._mobileWebFallBack\n }) + \"?\" + querystring.stringify(params);\n }.bind(this));\n };\n\n /**\n * Returns a boolean indicating whether the current browser supports Venmo as a payment method. Please note that iOS Chrome is not supported when the Venmo button is rendered in an iFrame.\n *\n * If `options.allowNewBrowserTab` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for browsers known to support returning from the Venmo app to the same browser tab. Currently, this is limited to iOS Safari and Android Chrome.\n * If `options.allowWebviews` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for mobile browsers that are not webviews.\n * @public\n * @returns {boolean} True if the current browser is supported, false if not.\n */\n Venmo.prototype.isBrowserSupported = function () {\n return isBrowserSupported.isBrowserSupported({\n allowNewBrowserTab: this._allowNewBrowserTab,\n allowWebviews: this._allowWebviews,\n allowDesktop: this._allowDesktop,\n allowDesktopWebLogin: this._allowDesktopWebLogin\n });\n };\n\n /**\n * Returns a boolean indicating whether a Venmo tokenization result is ready to be processed immediately.\n *\n * This method should be called after initialization to see if the result of Venmo authorization is available. If it returns true, call {@link Venmo#tokenize|tokenize} immediately to process the results.\n *\n * @public\n * @returns {boolean} True if the results of Venmo payment authorization are available and ready to process.\n */\n Venmo.prototype.hasTokenizationResult = function () {\n return this._hasTokenizationResult();\n };\n\n // a private version that lets us pass in a custom hash\n // when listening on a hashchange event\n Venmo.prototype._hasTokenizationResult = function (hash) {\n var params = getFragmentParameters(hash);\n return typeof (params.venmoSuccess || params.venmoError || params.venmoCancel) !== \"undefined\";\n };\n Venmo.prototype._shouldIncludeReturnUrls = function () {\n // when a deep link return url is passed, we should always\n // respect it and include the return urls so the venmo app\n // can app switch back to it\n if (this._deepLinkReturnUrl) {\n return true;\n }\n\n // when the sdk is initialized within an iframe, it's\n // impossible to return back to the correct place automatically\n // without also setting a deepLinkReturnUrl. When the return\n // urls are omitted, the Venmo app prompts the user to return\n // manually.\n return !this._cannotHaveReturnUrls;\n };\n Venmo.prototype._isDesktop = function () {\n return !(browserDetection.isIos() || browserDetection.isAndroid());\n };\n\n /**\n * Launches the Venmo flow and returns a nonce payload.\n *\n * If {@link Venmo#hasTokenizationResult|hasTokenizationResult} returns true, calling tokenize will immediately process and return the results without initiating the Venmo payment authorization flow.\n *\n * Only one Venmo flow can be active at a time. One way to achieve this is to disable your Venmo button while the flow is open.\n * @public\n * @param {object} [options] Options for tokenization.\n * @param {number} [options.processResultsDelay=500] The amount of time in milliseconds to delay processing the results. In most cases, this value should be left as the default.\n * @param {callback} [callback] The second argument, data, is a {@link Venmo~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Venmo~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * venmoInstance.tokenize().then(function (payload) {\n * // Submit payload.nonce to your server\n * // Use payload.username to get the Venmo username and display any UI\n * }).catch(function (tokenizeError) {\n * // Handle flow errors or premature flow closure\n * switch (tokenizeErr.code) {\n * case 'VENMO_APP_CANCELED':\n * console.log('User canceled Venmo flow.');\n * break;\n * case 'VENMO_CANCELED':\n * console.log('User canceled Venmo, or Venmo app is not available.');\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * }).then(function () {\n * button.removeAttribute('disabled');\n * });\n * });\n */\n Venmo.prototype.tokenize = function (options) {\n var self = this;\n var tokenizationPromise;\n options = options || {};\n if (this._tokenizationInProgress === true) {\n return Promise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_ACTIVE));\n }\n this._tokenizationInProgress = true;\n if (this._useDesktopQRFlow) {\n // for the desktop flow, we create a venmo payment\n // context and then present a qr code modal to the\n // customer and they will open up their venmo app\n // and scan it and approve the purchase on their\n // mobile device. The sdk will start polling\n // in order to determine when the status of the\n // payment context has updated and then pass the\n // resulting nonce back to the merchant.\n tokenizationPromise = this._tokenizeForDesktopQRFlow(options);\n } else if (this._useAllowDesktopWebLogin) {\n /**\n * For Desktop Web Login, we open a browser popup to allow for authorization. Once authorized, the redirect urls are used by Venmo, and we query the API for a payment context status update.\n *\n * - Payment context is created on initialization\n * - Popup is opened to Venmo login url.\n * - The payment is authorized or canceled, and the popup is closed\n * - Once the popup is closed, we query the API for a payment context status update\n *\n * This is an alternate, opt-in flow to be used the Desktop QR Flow is not desired for Pay with Venmo desktop experiences.\n */\n tokenizationPromise = this._tokenizeWebLoginWithRedirect();\n } else if (this._cannotHaveReturnUrls) {\n // in the manual return strategy, we create the payment\n // context on initialization, then continually poll once\n // the app switch begins until we get a response indiciating\n // the payment context was approved by the customer on the\n // Venmo app. The payment context response also includes a\n // nonce. There are 2 cases where we use the manual return\n // strategy:\n // 1. the sdk is instantiated in an iframe, because\n // the venmo app is unable to redirect automatically\n // when that is the case so we rely on the customer\n // to do a manual redirect and continunally poll for\n // updates on the payment context to get the nonce\n // 2. same deal for when `requireManualReturn` is configured\n tokenizationPromise = this._tokenizeForMobileWithManualReturn();\n } else {\n // the default mobile flow is to app switch to the\n // venmo app, and then have the venmo app switch\n // back to the page with the venmo nonce details\n // encoded into the hash portion of the url. If\n // `paymentMethodUsage` is provided when instantiating\n // the sdk, we also create a payment context and pass\n // the resource id to the Venmo app during the app switch.\n // Once we get a succesful return, we ping the payment\n // context query to get any additional data needed\n // to send back to the merchant.\n tokenizationPromise = this._tokenizeForMobileWithHashChangeListeners(options);\n }\n return tokenizationPromise.then(function (payload) {\n return self._createPromise.then(function (client) {\n return self._createVenmoPaymentContext(client);\n }).then(function () {\n self._tokenizationInProgress = false;\n return formatTokenizePayload(payload);\n });\n }).catch(function (err) {\n return self._createPromise.then(function (client) {\n // We create a new Payment Context because if the last one failed, then presumably we don't want to use it again.\n // On the first pass, we create the payment context at initialization, and since we used that first one we now need to create a new one\n // for the next time someone tries to tokenize.\n return self._createVenmoPaymentContext(client);\n }).then(function () {\n self._tokenizationInProgress = false;\n return Promise.reject(err);\n });\n });\n };\n\n /**\n * Cancels the venmo tokenization process\n *\n * @public\n * @function Venmo~cancelTokenization\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * venmoTokenizeButton.addEventListener('click', function () {\n * venmoInstance.tokenize().then(function (payload) {\n * // handle payload\n * }).catch(function (err) {\n * if (err.code === 'VENMO_TOKENIZATION_CANCELED_BY_MERCHANT') {\n * // tokenization was canceled by calling cancelTokenization\n * }\n * });\n * });\n *\n * venmoCancelButton.addEventListener('click', function () {\n * // Hide the button when the venmo flow is not in progress\n * venmoCancelButton.style.display = \"none\";\n *\n * venmoInstance.cancelTokenization().then(function () {\n * // done canceling the flow\n * }).catch(function (err) {\n * // should only get here if there is no tokenization in progress\n * });\n * });\n */\n Venmo.prototype.cancelTokenization = function () {\n if (!this._tokenizationInProgress) {\n return Promise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE));\n }\n this._removeVisibilityEventListener();\n\n // important to reject the tokenization promise first\n // so the tokenize method rejects with this error\n // rather than a customer canceled error in the mobile\n // polling and desktop flows\n if (this._tokenizePromise) {\n this._tokenizePromise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_CANCELED_BY_MERCHANT));\n }\n return Promise.all([this._cancelMobilePaymentContext(), this._cancelVenmoDesktopContext()]);\n };\n Venmo.prototype._tokenizeWebLoginWithRedirect = function () {\n var self = this;\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.web-login.start\");\n this._tokenizePromise = new ExtendedPromise();\n return this.getUrl().then(function (url) {\n desktopWebLogin.runWebLogin({\n checkForStatusChange: self._checkPaymentContextStatusAndProcessResult.bind(self),\n cancelTokenization: self.cancelTokenization.bind(self),\n frameServiceInstance: self._frameServiceInstance,\n venmoUrl: url,\n debug: self._isDebug,\n checkPaymentContextStatus: self._checkPaymentContextStatus.bind(self)\n }).then(function (payload) {\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.web-login.success\");\n self._tokenizePromise.resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId\n });\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.web-login.failure\");\n self._tokenizePromise.reject(err);\n });\n return self._tokenizePromise;\n });\n };\n Venmo.prototype._queryPaymentContextStatus = function (id) {\n var self = this;\n return this._createPromise.then(function (client) {\n var query = self._shouldUseLegacyFlow ? graphqlQueries.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY : graphqlQueries.VENMO_PAYMENT_CONTEXT_STATUS_QUERY;\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: {\n id: id\n }\n }\n });\n }).then(function (response) {\n return response.data.node;\n });\n };\n\n /**\n * Queries the GraphQL API to get the payment context and process the status. Retries until there is an update to the payment context status.\n * @name Venmo~checkPaymentContextStatusAndProcessResult\n * @ignore\n * @param {number} retryCount The counter for tracking number of retries made against the API.\n * @returns {Promise} Returns a promise\n */\n Venmo.prototype._checkPaymentContextStatusAndProcessResult = function (retryCount) {\n var self = this;\n return self._checkPaymentContextStatus().then(function (node) {\n var resultStatus = node.status;\n if (resultStatus !== self._venmoPaymentContextStatus) {\n self._venmoPaymentContextStatus = resultStatus;\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.web-login.status-change\");\n switch (resultStatus) {\n case \"APPROVED\":\n return Promise.resolve(node);\n case \"CANCELED\":\n return Promise.reject(new BraintreeError(errors.VENMO_CUSTOMER_CANCELED));\n case \"FAILED\":\n return Promise.reject(new BraintreeError(errors.VENMO_TOKENIZATION_FAILED));\n default:\n }\n }\n return new Promise(function (resolve, reject) {\n if (retryCount < self._maxRetryCount) {\n retryCount++;\n return self._checkPaymentContextStatusAndProcessResult(retryCount).then(resolve).catch(reject);\n }\n return reject(new BraintreeError(errors.VENMO_TOKENIZATION_FAILED));\n });\n });\n };\n Venmo.prototype._checkPaymentContextStatus = function () {\n var self = this;\n return self._queryPaymentContextStatus(self._venmoPaymentContextId).catch(function (networkError) {\n return Promise.reject(new BraintreeError({\n type: errors.VENMO_NETWORK_ERROR.type,\n code: errors.VENMO_NETWORK_ERROR.code,\n message: errors.VENMO_NETWORK_ERROR.message,\n details: networkError\n }));\n }).then(function (node) {\n return Promise.resolve(node);\n });\n };\n Venmo.prototype._pollForStatusChange = function () {\n var self = this;\n if (Date.now() > self._mobilePollingContextExpiresIn) {\n return Promise.reject(new BraintreeError(errors.VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT));\n }\n return this._queryPaymentContextStatus(this._venmoPaymentContextId).catch(function (networkError) {\n return Promise.reject(new BraintreeError({\n type: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.type,\n code: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.code,\n message: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.message,\n details: {\n originalError: networkError\n }\n }));\n }).then(function (node) {\n var newStatus = node.status;\n if (newStatus !== self._venmoPaymentContextStatus) {\n self._venmoPaymentContextStatus = newStatus;\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.manual-return.status-change.\" + newStatus.toLowerCase());\n switch (newStatus) {\n case \"EXPIRED\":\n case \"FAILED\":\n case \"CANCELED\":\n return Promise.reject(new BraintreeError(errors[\"VENMO_MOBILE_POLLING_TOKENIZATION_\" + newStatus]));\n case \"APPROVED\":\n return Promise.resolve(node);\n case \"CREATED\":\n case \"SCANNED\":\n default:\n // any other statuses are irrelevant to the polling\n // and can just be ignored\n }\n }\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n self._pollForStatusChange().then(resolve).catch(reject);\n }, self._mobilePollingInterval);\n });\n });\n };\n Venmo.prototype._tokenizeForMobileWithManualReturn = function () {\n var self = this;\n analytics.sendEvent(this._createPromise, \"venmo.tokenize.manual-return.start\");\n this._mobilePollingContextExpiresIn = Date.now() + this._mobilePollingExpiresThreshold;\n this._tokenizePromise = new ExtendedPromise();\n this._pollForStatusChange().then(function (payload) {\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.manual-return.success\");\n self._tokenizePromise.resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId\n });\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.manual-return.failure\");\n self._tokenizePromise.reject(err);\n });\n return this.getUrl().then(function (url) {\n self.appSwitch(url);\n return self._tokenizePromise;\n });\n };\n Venmo.prototype._shouldUseRedirectStrategy = function () {\n if (!browserDetection.isIos()) {\n return false;\n }\n if (this._mobileWebFallBack === true) {\n return true;\n }\n return this._useRedirectForIOS;\n };\n Venmo.prototype._tokenizeForMobileWithHashChangeListeners = function (options) {\n var self = this;\n var resultProcessingInProgress, visibilityChangeListenerTimeout;\n if (this.hasTokenizationResult()) {\n return this.processHashChangeFlowResults();\n }\n analytics.sendEvent(this._createPromise, \"venmo.tokenize.mobile.start\");\n this._tokenizePromise = new ExtendedPromise();\n this._previousHash = window.location.hash;\n function completeFlow(hash) {\n var error;\n self.processHashChangeFlowResults(hash).catch(function (err) {\n error = err;\n }).then(function (res) {\n if (!self._ignoreHistoryChanges && window.location.hash !== self._previousHash) {\n window.location.hash = self._previousHash;\n }\n self._removeVisibilityEventListener();\n if (error) {\n self._tokenizePromise.reject(error);\n } else {\n self._tokenizePromise.resolve(res);\n }\n delete self._tokenizePromise;\n });\n }\n\n // The Venmo SDK app switches back with the results of the\n // tokenization encoded in the hash\n this._onHashChangeListener = function (e) {\n var hash = e.newURL.split(\"#\")[1];\n if (!self._hasTokenizationResult(hash)) {\n return;\n }\n resultProcessingInProgress = true;\n clearTimeout(visibilityChangeListenerTimeout);\n completeFlow(hash);\n };\n window.addEventListener(\"hashchange\", this._onHashChangeListener, false);\n\n // Subscribe to document visibility change events to detect when app switch\n // has returned. Acts as a fallback for the hashchange listener and catches\n // the cancel case via manual app switch back\n this._visibilityChangeListener = function () {\n var delay = options.processResultsDelay || constants.DEFAULT_PROCESS_RESULTS_DELAY;\n if (!window.document.hidden) {\n if (!resultProcessingInProgress) {\n visibilityChangeListenerTimeout = setTimeout(completeFlow, delay);\n }\n }\n };\n return this.getUrl().then(function (url) {\n self.appSwitch(url);\n\n // Add a brief delay to ignore visibility change events that occur right before app switch\n setTimeout(function () {\n window.document.addEventListener(documentVisibilityChangeEventName(), self._visibilityChangeListener);\n }, constants.DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY);\n return self._tokenizePromise;\n });\n };\n Venmo.prototype._tokenizeForDesktopQRFlow = function () {\n var self = this;\n analytics.sendEvent(this._createPromise, \"venmo.tokenize.desktop.start\");\n this._tokenizePromise = new ExtendedPromise();\n this._createPromise.then(function () {\n return self._venmoDesktopInstance.launchDesktopFlow();\n }).then(function (payload) {\n self._venmoDesktopInstance.hideDesktopFlow();\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.desktop.success\");\n self._tokenizePromise.resolve(payload);\n }).catch(function (err) {\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.desktop.failure\");\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.hideDesktopFlow();\n }\n if (err && err.reason === \"CUSTOMER_CANCELED\") {\n self._tokenizePromise.reject(new BraintreeError(errors.VENMO_DESKTOP_CANCELED));\n return;\n }\n self._tokenizePromise.reject(new BraintreeError({\n type: errors.VENMO_DESKTOP_UNKNOWN_ERROR.type,\n code: errors.VENMO_DESKTOP_UNKNOWN_ERROR.code,\n message: errors.VENMO_DESKTOP_UNKNOWN_ERROR.message,\n details: {\n originalError: err\n }\n }));\n });\n return this._tokenizePromise;\n };\n Venmo.prototype._cancelMobilePaymentContext = function () {\n var self = this;\n return this._createPromise.then(function (client) {\n var query;\n if (self._venmoPaymentContextId) {\n query = self._shouldUseLegacyFlow ? graphqlQueries.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY : graphqlQueries.UPDATE_PAYMENT_CONTEXT_QUERY;\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: {\n input: {\n id: self._venmoPaymentContextId,\n status: \"CANCELED\"\n }\n }\n }\n });\n }\n return Promise.resolve();\n });\n };\n Venmo.prototype._cancelVenmoDesktopContext = function () {\n var self = this;\n return this._createPromise.then(function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.updateVenmoDesktopPaymentContext(\"CANCELED\");\n }\n return Promise.resolve();\n });\n };\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/venmo.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * venmoInstance.teardown();\n * @example With callback\n * venmoInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n Venmo.prototype.teardown = function () {\n var self = this;\n this._removeVisibilityEventListener();\n return this._createPromise.then(function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.teardown();\n }\n clearTimeout(self._refreshPaymentContextTimeout);\n self._cancelMobilePaymentContext();\n convertMethodsToError(this, methods(Venmo.prototype));\n }.bind(this));\n };\n Venmo.prototype._removeVisibilityEventListener = function () {\n window.removeEventListener(\"hashchange\", this._onHashChangeListener);\n window.document.removeEventListener(documentVisibilityChangeEventName(), this._visibilityChangeListener);\n delete this._visibilityChangeListener;\n delete this._onHashChangeListener;\n };\n\n /**\n * The hash parameter in this function is optional. If no hash parameter is passed, the `getFragmentParameters` function will default to the hash present in the website's URL instead.\n *\n * There are two scenarios where this method is called:\n *\n * 1. When called within a browser that is capable of returning to the same tab that started the Venmo flow, we set up a listener to detect hash changes in the url. Part of the return to the merchant's website from the Venmo app includes encoding the details of the purchase in the hash of the url. The callback is invoked and the hash is pulled off from the event payload. The reason we pull the hash off of the event payload instead of pulling it directly from the URL is because sometimes a single page app will use the hash parameter for it's routing system, and it's possible to hit a race condition where the routing code has already removed the Venmo specific attributes from the hash before we are able to pull it off the url. Grabbing the hash from the event handler instead ensures we get the Venmo details, no matter what the url is converted to.\n * 2. The other scenario is for browsers that cannot return to the same tab, and instead the Venmo app must open a new tab. Since there is no hash listener to pull the hash from, we pull the hash details directly from the url using the `getFragmentParameters` method.\n *\n * @ignore\n * @param {string} [hash] Optionally provided browser url hash.\n * @returns {Promise} Returns a promise\n */\n Venmo.prototype.processHashChangeFlowResults = function (hash) {\n var self = this;\n var params = getFragmentParameters(hash);\n\n // NEXT_MAJOR_VERSION only rely on payment context status call and stop relying on the\n // content of the hash\n\n return new Promise(function (resolve, reject) {\n if (!self._shouldUseLegacyFlow) {\n self._pollForStatusChange().then(function (payload) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.payment-context-status-query.success\");\n return resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId\n });\n }).catch(function (err) {\n if (err.type === errors.VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED.type) {\n // We want to reject in this case because if it the process was canceled, we don't want to take the happy path\n reject(err);\n }\n analytics.sendEvent(self._createPromise, \"venmo.process-results.payment-context-status-query-failed\");\n // If the polling request fails, but not because of cancelization, we will rely on the params provided from the hash\n resolve(params);\n });\n } else if (params.venmoSuccess) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.success\");\n resolve(params);\n } else if (params.venmoError) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.error\");\n reject(new BraintreeError({\n type: errors.VENMO_APP_FAILED.type,\n code: errors.VENMO_APP_FAILED.code,\n message: errors.VENMO_APP_FAILED.message,\n details: {\n originalError: {\n message: decodeURIComponent(params.errorMessage),\n code: params.errorCode\n }\n }\n }));\n } else if (params.venmoCancel) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.cancel\");\n reject(new BraintreeError(errors.VENMO_APP_CANCELED));\n } else {\n // User has either manually switched back to browser, or app is not available for app switch\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.cancel-or-unavailable\");\n reject(new BraintreeError(errors.VENMO_CANCELED));\n }\n self._clearFragmentParameters();\n });\n };\n Venmo.prototype._clearFragmentParameters = function () {\n if (this._ignoreHistoryChanges) {\n return;\n }\n if (typeof window.history.replaceState === \"function\" && window.location.hash) {\n history.pushState({}, \"\", window.location.href.slice(0, window.location.href.indexOf(\"#\")));\n }\n };\n function getFragmentParameters(hash) {\n var keyValuesArray = (hash || window.location.hash.substring(1)).split(\"&\");\n var parsedParams = keyValuesArray.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split(\"=\");\n // some Single Page Apps may pre-pend a / to the first value\n // in the hash, assuming it's a route in their app\n // instead of information from Venmo, this removes all\n // non-alphanumeric characters from the keys in the params\n var decodedKey = decodeURIComponent(parts[0]).replace(/\\W/g, \"\");\n var key = snakeCaseToCamelCase(decodedKey);\n var value = decodeURIComponent(parts[1]);\n toReturn[key] = value;\n return toReturn;\n }, {});\n if (parsedParams.resourceId) {\n parsedParams.id = parsedParams.resourceId;\n }\n return parsedParams;\n }\n function formatUserName(username) {\n username = username || \"\";\n\n // NEXT_MAJOR_VERSION the web sdks have a prepended @ sign\n // but the ios and android ones do not. This should be standardized\n return \"@\" + username.replace(\"@\", \"\");\n }\n function formatTokenizePayload(payload) {\n var formattedPayload = {\n nonce: payload.paymentMethodNonce,\n type: \"VenmoAccount\",\n details: {\n username: formatUserName(payload.username),\n paymentContextId: payload.id\n }\n };\n if (payload.payerInfo) {\n formattedPayload.details.payerInfo = payload.payerInfo;\n formattedPayload.details.payerInfo.userName = formatUserName(payload.payerInfo.userName);\n }\n return formattedPayload;\n }\n\n // From https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\n function documentVisibilityChangeEventName() {\n var visibilityChange;\n if (typeof window.document.hidden !== \"undefined\") {\n // Opera 12.10 and Firefox 18 and later support\n visibilityChange = \"visibilitychange\";\n } else if (typeof window.document.msHidden !== \"undefined\") {\n visibilityChange = \"msvisibilitychange\";\n } else if (typeof window.document.webkitHidden !== \"undefined\") {\n visibilityChange = \"webkitvisibilitychange\";\n }\n return visibilityChange;\n }\n function isIosWebviewInDeepLinkReturnUrlFlow() {\n // we know it's a webview because this flow only gets\n // used when checking the deep link flow\n // test the platform here to get around custom useragents\n return window.navigator.platform && /iPhone|iPad|iPod/.test(window.navigator.platform);\n }\n module.exports = wrapPromise.wrapPrototype(Venmo);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/braintree-error\": 124,\n \"../lib/convert-methods-to-error\": 127,\n \"../lib/in-iframe\": 150,\n \"../lib/is-verified-domain\": 153,\n \"../lib/methods\": 155,\n \"../lib/querystring\": 157,\n \"../lib/snake-case-to-camel-case\": 159,\n \"./external/\": 213,\n \"./external/queries\": 214,\n \"./shared/browser-detection\": 217,\n \"./shared/constants\": 218,\n \"./shared/errors\": 219,\n \"./shared/get-venmo-url\": 221,\n \"./shared/supports-venmo\": 222,\n \"./shared/web-login-backdrop\": 223,\n \"@braintree/extended-promise\": 34,\n \"@braintree/wrap-promise\": 43\n }],\n 225: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @name BraintreeError.Visa Checkout - Creation Error Codes\n * @description Errors that occur when [creating the Visa Checkout component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VISA_CHECKOUT_NOT_ENABLED Occurs when Visa Checkout is not enabled in the Braintree control panel.\n */\n\n /**\n * @name BraintreeError.Visa Checkout - createInitOptions Error Codes\n * @description Errors that occur when using the [`createInitOptions` method](./VisaCheckout.html#createInitOptions).\n * @property {MERCHANT} VISA_CHECKOUT_INIT_OPTIONS_REQUIRED Occurs when no options are provided to method.\n */\n\n /**\n * @name BraintreeError.Visa Checkout - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./VisaCheckout.html#tokenize).\n * @property {MERCHANT} VISA_CHECKOUT_PAYMENT_REQUIRED Occurs when no payment data is not provided.\n * @property {NETWORK} VISA_CHECKOUT_TOKENIZATION Occurs when tokenization fails.\n */\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n module.exports = {\n VISA_CHECKOUT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_NOT_ENABLED\",\n message: \"Visa Checkout is not enabled for this merchant.\"\n },\n VISA_CHECKOUT_INIT_OPTIONS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_INIT_OPTIONS_REQUIRED\",\n message: \"initOptions requires an object.\"\n },\n VISA_CHECKOUT_PAYMENT_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_PAYMENT_REQUIRED\",\n message: \"tokenize requires callid, encKey, and encPaymentData.\"\n },\n VISA_CHECKOUT_TOKENIZATION: {\n type: BraintreeError.types.NETWORK,\n code: \"VISA_CHECKOUT_TOKENIZATION\",\n message: \"A network error occurred when processing the Visa Checkout payment.\"\n }\n };\n }, {\n \"../lib/braintree-error\": 124\n }],\n 226: [function (_dereq_, module, exports) {\n \"use strict\";\n\n /**\n * @module braintree-web/visa-checkout\n * @description Processes Visa Checkout. *This component is currently in beta and is subject to change.*\n */\n var basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n var createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\n var VisaCheckout = _dereq_(\"./visa-checkout\");\n var analytics = _dereq_(\"../lib/analytics\");\n var errors = _dereq_(\"./errors\");\n var VERSION = \"3.101.1\";\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n /**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link VisaCheckout} instance. If no callback is provided, `create` returns a promise that resolves with the {@link VisaCheckout} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n function create(options) {\n var name = \"Visa Checkout\";\n return basicComponentVerification.verify({\n name: name,\n client: options.client,\n authorization: options.authorization\n }).then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name\n });\n }).then(function (client) {\n options.client = client;\n if (!options.client.getConfiguration().gatewayConfiguration.visaCheckout) {\n return Promise.reject(new BraintreeError(errors.VISA_CHECKOUT_NOT_ENABLED));\n }\n analytics.sendEvent(options.client, \"visacheckout.initialized\");\n return new VisaCheckout(options);\n });\n }\n module.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION\n };\n }, {\n \"../lib/analytics\": 119,\n \"../lib/basic-component-verification\": 122,\n \"../lib/braintree-error\": 124,\n \"../lib/create-assets-url\": 129,\n \"../lib/create-deferred-client\": 131,\n \"./errors\": 225,\n \"./visa-checkout\": 227,\n \"@braintree/wrap-promise\": 43\n }],\n 227: [function (_dereq_, module, exports) {\n \"use strict\";\n\n var BraintreeError = _dereq_(\"../lib/braintree-error\");\n var analytics = _dereq_(\"../lib/analytics\");\n var errors = _dereq_(\"./errors\");\n var jsonClone = _dereq_(\"../lib/json-clone\");\n var methods = _dereq_(\"../lib/methods\");\n var convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\n var wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n var cardTypeTransformMap = {\n Visa: \"VISA\",\n MasterCard: \"MASTERCARD\",\n Discover: \"DISCOVER\",\n \"American Express\": \"AMEX\"\n };\n\n /**\n * Visa Checkout Address object.\n * @typedef {object} VisaCheckout~Address\n * @property {string} countryCode The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} firstName The customer's first name.\n * @property {string} lastName The customer's last name.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n * @property {string} phoneNumber The customer's phone number.\n */\n\n /**\n * Visa Checkout UserData object.\n * @typedef {object} VisaCheckout~UserData\n * @property {string} userEmail The customer's email address.\n * @property {string} userFirstName The customer's first name.\n * @property {string} userLastName The customer's last name.\n * @property {string} userFullName The customer's full name.\n * @property {string} userName The customer's username.\n */\n\n /**\n * Visa Checkout tokenize payload.\n * @typedef {object} VisaCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, always `VisaCheckoutCard`.\n * @property {VisaCheckout~Address} billingAddress The customer's billing address.\n * @property {VisaCheckout~Address} shippingAddress The customer's shipping address.\n * @property {VisaCheckout~UserData} userData Information about the customer.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n /**\n * @class\n * @param {object} options The Visa Checkout {@link module:braintree-web/visa-checkout.create create} options.\n * @description Do not use this constructor directly. Use {@link module:braintree-web/visa-checkout.create|braintree-web.visa-checkout.create} instead.\n * @classdesc This class represents a Visa Checkout component produced by {@link module:braintree-web/visa-checkout.create|braintree-web/visa-checkout.create}. Instances of this class have methods for interacting with Visa Checkout's JavaScript library.\n */\n function VisaCheckout(options) {\n this._client = options.client;\n }\n function transformCardTypes(cardTypes) {\n return cardTypes.reduce(function (acc, type) {\n if (cardTypeTransformMap.hasOwnProperty(type)) {\n return acc.concat(cardTypeTransformMap[type]);\n }\n return acc;\n }, []);\n }\n\n /**\n * Creates an `initOptions` object from the passed `options`, applying properties that Braintree needs to transact Visa Checkout.\n *\n * Braintree will apply these properties if they do not exist on the given `options`:\n * - `apikey`\n * - `externalClientId`\n * - `settings.payment.cardBrands`\n *\n * Braintree will overwrite `settings.dataLevel = 'FULL'` to access the full payment method.\n * @public\n * @param {object} options The base `initOptions` that will be used to init Visa Checkout.\n * @param {string} [options.apikey] The API key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {string} [options.externalClientId] The external client ID key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {object} [options.settings] The settings object used to initialize Visa Checkout.\n * @param {string} [options.settings.dataLevel] The data level used to initialize Visa Checkout. Braintree will overwrite this property to 'FULL'.\n * @param {object} [options.settings.payment] The payment object used to initialize Visa Checkout.\n * @param {string[]} [options.settings.payment.cardBrands] The card brands that Visa Checkout will allow the customer to pay with. When not supplied, Braintree will set this property.\n * @returns {object} `initOptions` The `initOptions` that Visa Checkout should be initialized with.\n */\n VisaCheckout.prototype.createInitOptions = function (options) {\n var initOptions;\n var gatewayConfiguration = this._client.getConfiguration().gatewayConfiguration;\n var visaCheckoutConfiguration = gatewayConfiguration.visaCheckout;\n if (!options) {\n throw new BraintreeError(errors.VISA_CHECKOUT_INIT_OPTIONS_REQUIRED);\n }\n initOptions = jsonClone(options);\n initOptions.apikey = initOptions.apikey || visaCheckoutConfiguration.apikey;\n initOptions.encryptionKey = visaCheckoutConfiguration.encryptionKey;\n initOptions.externalClientId = initOptions.externalClientId || visaCheckoutConfiguration.externalClientId;\n initOptions.settings = initOptions.settings || {};\n initOptions.settings.dataLevel = \"FULL\";\n initOptions.settings.payment = initOptions.settings.payment || {};\n if (!initOptions.settings.payment.cardBrands) {\n initOptions.settings.payment.cardBrands = transformCardTypes(gatewayConfiguration.visaCheckout.supportedCardTypes);\n }\n return initOptions;\n };\n\n /**\n * Tokenizes the Visa Checkout payload, returning a payment method nonce.\n * @public\n * @param {object} payment The object that Visa Checkout supplies on `payment.success`.\n * @param {string} payment.callid Visa Checkout transaction ID associated with this payment.\n * @param {string} payment.encKey The encrypted key used to decrypt the payment data.\n * @param {string} payment.encPaymentData The encrypted payment data.\n * @param {callback} [callback] The second argument, tokenizePayload is a {@link VisaCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with the {@link VisaCheckout~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n VisaCheckout.prototype.tokenize = function (payment) {\n var self = this;\n if (!payment.callid || !payment.encKey || !payment.encPaymentData) {\n return Promise.reject(new BraintreeError(errors.VISA_CHECKOUT_PAYMENT_REQUIRED));\n }\n return this._client.request({\n method: \"post\",\n endpoint: \"payment_methods/visa_checkout_cards\",\n data: {\n _meta: {\n source: \"visa-checkout\"\n },\n visaCheckoutCard: {\n callId: payment.callid,\n encryptedPaymentData: payment.encPaymentData,\n encryptedKey: payment.encKey\n }\n }\n }).then(function (response) {\n analytics.sendEvent(self._client, \"visacheckout.tokenize.succeeded\");\n return response.visaCheckoutCards[0];\n }).catch(function (err) {\n analytics.sendEvent(self._client, \"visacheckout.tokenize.failed\");\n return Promise.reject(new BraintreeError({\n type: errors.VISA_CHECKOUT_TOKENIZATION.type,\n code: errors.VISA_CHECKOUT_TOKENIZATION.code,\n message: errors.VISA_CHECKOUT_TOKENIZATION.message,\n details: {\n originalError: err\n }\n }));\n });\n };\n\n /**\n * Cleanly tear down anything set up by {@link module:braintree-web/visa-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * visaCheckoutInstance.teardown();\n * @example With callback\n * visaCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n VisaCheckout.prototype.teardown = function () {\n convertMethodsToError(this, methods(VisaCheckout.prototype));\n return Promise.resolve();\n };\n module.exports = wrapPromise.wrapPrototype(VisaCheckout);\n }, {\n \"../lib/analytics\": 119,\n \"../lib/braintree-error\": 124,\n \"../lib/convert-methods-to-error\": 127,\n \"../lib/json-clone\": 154,\n \"../lib/methods\": 155,\n \"./errors\": 225,\n \"@braintree/wrap-promise\": 43\n }]\n }, {}, [117])(117);\n});","var g;\n\n// This works in non-strict mode\ng = function () {\n return this;\n}();\ntry {\n // This works if eval is allowed (see CSP)\n g = g || new Function(\"return this\")();\n} catch (e) {\n // This works if the window reference is available\n if (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;","/**\n * @license AngularJS v1.8.3\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function (window) {\n 'use strict';\n\n /* exported\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth\n */\n var minErrConfig = {\n objectMaxDepth: 5,\n urlErrorParamsEnabled: true\n };\n\n /**\n * @ngdoc function\n * @name angular.errorHandlingConfig\n * @module ng\n * @kind function\n *\n * @description\n * Configure several aspects of error handling in AngularJS if used as a setter or return the\n * current configuration if used as a getter. The following options are supported:\n *\n * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.\n *\n * Omitted or undefined options will leave the corresponding configuration values unchanged.\n *\n * @param {Object=} config - The configuration object. May only contain the options that need to be\n * updated. Supported keys:\n *\n * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a\n * non-positive or non-numeric value, removes the max depth limit.\n * Default: 5\n *\n * * `urlErrorParamsEnabled` **{Boolean}** - Specifies whether the generated error url will\n * contain the parameters of the thrown error. Disabling the parameters can be useful if the\n * generated error url is very long.\n *\n * Default: true. When used without argument, it returns the current value.\n */\n function errorHandlingConfig(config) {\n if (isObject(config)) {\n if (isDefined(config.objectMaxDepth)) {\n minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;\n }\n if (isDefined(config.urlErrorParamsEnabled) && isBoolean(config.urlErrorParamsEnabled)) {\n minErrConfig.urlErrorParamsEnabled = config.urlErrorParamsEnabled;\n }\n } else {\n return minErrConfig;\n }\n }\n\n /**\n * @private\n * @param {Number} maxDepth\n * @return {boolean}\n */\n function isValidObjectMaxDepth(maxDepth) {\n return isNumber(maxDepth) && maxDepth > 0;\n }\n\n /**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * AngularJS. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace'). Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\n function minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n var url = 'https://errors.angularjs.org/1.8.3/';\n var regex = url.replace('.', '\\\\.') + '[\\\\s\\\\S]*';\n var errRegExp = new RegExp(regex, 'g');\n return function () {\n var code = arguments[0],\n template = arguments[1],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n templateArgs = sliceArgs(arguments, 2).map(function (arg) {\n return toDebugString(arg, minErrConfig.objectMaxDepth);\n }),\n paramPrefix,\n i;\n\n // A minErr message has two parts: the message itself and the url that contains the\n // encoded message.\n // The message's parameters can contain other error messages which also include error urls.\n // To prevent the messages from getting too long, we strip the error urls from the parameters.\n\n message += template.replace(/\\{\\d+\\}/g, function (match) {\n var index = +match.slice(1, -1);\n if (index < templateArgs.length) {\n return templateArgs[index].replace(errRegExp, '');\n }\n return match;\n });\n message += '\\n' + url + (module ? module + '/' : '') + code;\n if (minErrConfig.urlErrorParamsEnabled) {\n for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);\n }\n }\n return new ErrorConstructor(message);\n };\n }\n\n /* We need to tell ESLint what variables are being exported */\n /* exported\n angular,\n msie,\n jqLite,\n jQuery,\n slice,\n splice,\n push,\n toString,\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth,\n ngMinErr,\n angularModule,\n uid,\n REGEX_STRING_REGEXP,\n VALIDITY_STATE_PROPERTY,\n \n lowercase,\n uppercase,\n nodeName_,\n isArrayLike,\n forEach,\n forEachSorted,\n reverseParams,\n nextUid,\n setHashKey,\n extend,\n toInt,\n inherit,\n merge,\n noop,\n identity,\n valueFn,\n isUndefined,\n isDefined,\n isObject,\n isBlankObject,\n isString,\n isNumber,\n isNumberNaN,\n isDate,\n isError,\n isArray,\n isFunction,\n isRegExp,\n isWindow,\n isScope,\n isFile,\n isFormData,\n isBlob,\n isBoolean,\n isPromiseLike,\n trim,\n escapeForRegexp,\n isElement,\n makeMap,\n includes,\n arrayRemove,\n copy,\n simpleCompare,\n equals,\n csp,\n jq,\n concat,\n sliceArgs,\n bind,\n toJsonReplacer,\n toJson,\n fromJson,\n convertTimezoneToLocal,\n timezoneToOffset,\n addDateMinutes,\n startingTag,\n tryDecodeURIComponent,\n parseKeyValue,\n toKeyValue,\n encodeUriSegment,\n encodeUriQuery,\n angularInit,\n bootstrap,\n getTestability,\n snake_case,\n bindJQuery,\n assertArg,\n assertArgFn,\n assertNotHasOwnProperty,\n getter,\n getBlockNodes,\n hasOwnProperty,\n createMap,\n stringify,\n UNSAFE_restoreLegacyJqLiteXHTMLReplacement,\n \n NODE_TYPE_ELEMENT,\n NODE_TYPE_ATTRIBUTE,\n NODE_TYPE_TEXT,\n NODE_TYPE_COMMENT,\n NODE_TYPE_DOCUMENT,\n NODE_TYPE_DOCUMENT_FRAGMENT\n */\n\n ////////////////////////////////////\n\n /**\n * @ngdoc module\n * @name ng\n * @module ng\n * @installation\n * @description\n *\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n */\n\n var REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n // The name of a form control's ValidityState property.\n // This is used so that it's possible for internal tests to create mock ValidityStates.\n var VALIDITY_STATE_PROPERTY = 'validity';\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n /**\n * @private\n *\n * @description Converts the specified string to lowercase.\n * @param {string} string String to be converted to lowercase.\n * @returns {string} Lowercased string.\n */\n var lowercase = function (string) {\n return isString(string) ? string.toLowerCase() : string;\n };\n\n /**\n * @private\n *\n * @description Converts the specified string to uppercase.\n * @param {string} string String to be converted to uppercase.\n * @returns {string} Uppercased string.\n */\n var uppercase = function (string) {\n return isString(string) ? string.toUpperCase() : string;\n };\n var msie,\n // holds major version number for IE, or NaN if UA is not IE.\n jqLite,\n // delay binding since jQuery could be loaded after us.\n jQuery,\n // delay binding\n slice = [].slice,\n splice = [].splice,\n push = [].push,\n toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n ngMinErr = minErr('ng'),\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n uid = 0;\n\n // Support: IE 9-11 only\n /**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\n msie = window.document.documentMode;\n\n /**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\n function isArrayLike(obj) {\n // `null`, `undefined` and `window` are not array-like\n if (obj == null || isWindow(obj)) return false;\n\n // arrays, strings and jQuery/jqLite objects are array like\n // * jqLite is either the jQuery or jqLite constructor function\n // * we have to check the existence of jqLite first as this method is called\n // via the forEach method when constructing the jqLite object in the first place\n if (isArray(obj) || isString(obj) || jqLite && obj instanceof jqLite) return true;\n\n // Support: iOS 8.2 (not reproducible in simulator)\n // \"length\" in obj used to prevent JIT error (gh-11508)\n var length = 'length' in Object(obj) && obj.length;\n\n // NodeList objects (with `item` method) and\n // other objects with suitable length characteristics are array-like\n return isNumber(length) && (length >= 0 && length - 1 in obj || typeof obj.item === 'function');\n }\n\n /**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\n function forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj) || isArrayLike(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else if (isBlankObject(obj)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n } else if (typeof obj.hasOwnProperty === 'function') {\n // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else {\n // Slow path for objects which do not have a method `hasOwnProperty`\n for (key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n }\n function forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n }\n\n /**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\n function reverseParams(iteratorFn) {\n return function (value, key) {\n iteratorFn(key, value);\n };\n }\n\n /**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\n function nextUid() {\n return ++uid;\n }\n\n /**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\n function setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n }\n function baseExtend(dst, objs, deep) {\n var h = dst.$$hashKey;\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n if (deep && isObject(src)) {\n if (isDate(src)) {\n dst[key] = new Date(src.valueOf());\n } else if (isRegExp(src)) {\n dst[key] = new RegExp(src);\n } else if (src.nodeName) {\n dst[key] = src.cloneNode(true);\n } else if (isElement(src)) {\n dst[key] = src.clone();\n } else {\n if (key !== '__proto__') {\n if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n baseExtend(dst[key], [src], true);\n }\n }\n } else {\n dst[key] = src;\n }\n }\n }\n setHashKey(dst, h);\n return dst;\n }\n\n /**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\n function extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n }\n\n /**\n * @ngdoc function\n * @name angular.merge\n * @module ng\n * @kind function\n *\n * @description\n * Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n *\n * Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n * objects, performing a deep copy.\n *\n * @deprecated\n * sinceVersion=\"1.6.5\"\n * This function is deprecated, but will not be removed in the 1.x lifecycle.\n * There are edge cases (see {@link angular.merge#known-issues known issues}) that are not\n * supported by this function. We suggest using another, similar library for all-purpose merging,\n * such as [lodash's merge()](https://lodash.com/docs/4.17.4#merge).\n *\n * @knownIssue\n * This is a list of (known) object types that are not handled correctly by this function:\n * - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)\n * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)\n * - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)\n * - AngularJS {@link $rootScope.Scope scopes};\n *\n * `angular.merge` also does not support merging objects with circular references.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\n function merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n }\n function toInt(str) {\n return parseInt(str, 10);\n }\n var isNumberNaN = Number.isNaN || function isNumberNaN(num) {\n // eslint-disable-next-line no-self-compare\n return num !== num;\n };\n function inherit(parent, extra) {\n return extend(Object.create(parent), extra);\n }\n\n /**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\n function noop() {}\n noop.$inject = [];\n\n /**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n \n // E.g.\n function getResult(fn, input) {\n return (fn || angular.identity)(input);\n };\n \n getResult(function(n) { return n * 2; }, 21); // returns 42\n getResult(null, 21); // returns 21\n getResult(undefined, 21); // returns 21\n ```\n *\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\n function identity($) {\n return $;\n }\n identity.$inject = [];\n function valueFn(value) {\n return function valueRef() {\n return value;\n };\n }\n function hasCustomToString(obj) {\n return isFunction(obj.toString) && obj.toString !== toString;\n }\n\n /**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\n function isUndefined(value) {\n return typeof value === 'undefined';\n }\n\n /**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\n function isDefined(value) {\n return typeof value !== 'undefined';\n }\n\n /**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\n function isObject(value) {\n // http://jsperf.com/isobject4\n return value !== null && typeof value === 'object';\n }\n\n /**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\n function isBlankObject(value) {\n return value !== null && typeof value === 'object' && !getPrototypeOf(value);\n }\n\n /**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\n function isString(value) {\n return typeof value === 'string';\n }\n\n /**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\n function isNumber(value) {\n return typeof value === 'number';\n }\n\n /**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\n function isDate(value) {\n return toString.call(value) === '[object Date]';\n }\n\n /**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\n function isArray(arr) {\n return Array.isArray(arr) || arr instanceof Array;\n }\n\n /**\n * @description\n * Determines if a reference is an `Error`.\n * Loosely based on https://www.npmjs.com/package/iserror\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Error`.\n */\n function isError(value) {\n var tag = toString.call(value);\n switch (tag) {\n case '[object Error]':\n return true;\n case '[object Exception]':\n return true;\n case '[object DOMException]':\n return true;\n default:\n return value instanceof Error;\n }\n }\n\n /**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\n function isFunction(value) {\n return typeof value === 'function';\n }\n\n /**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\n function isRegExp(value) {\n return toString.call(value) === '[object RegExp]';\n }\n\n /**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\n function isWindow(obj) {\n return obj && obj.window === obj;\n }\n function isScope(obj) {\n return obj && obj.$evalAsync && obj.$watch;\n }\n function isFile(obj) {\n return toString.call(obj) === '[object File]';\n }\n function isFormData(obj) {\n return toString.call(obj) === '[object FormData]';\n }\n function isBlob(obj) {\n return toString.call(obj) === '[object Blob]';\n }\n function isBoolean(value) {\n return typeof value === 'boolean';\n }\n function isPromiseLike(obj) {\n return obj && isFunction(obj.then);\n }\n var TYPED_ARRAY_REGEXP = /^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;\n function isTypedArray(value) {\n return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));\n }\n function isArrayBuffer(obj) {\n return toString.call(obj) === '[object ArrayBuffer]';\n }\n var trim = function (value) {\n return isString(value) ? value.trim() : value;\n };\n\n // Copied from:\n // http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n // Prereq: s is a string.\n var escapeForRegexp = function (s) {\n return s.replace(/([-()[\\]{}+?*.$^|,:#= 0) {\n array.splice(index, 1);\n }\n return index;\n }\n\n /**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array. This functions is used\n * internally, mostly in the change-detection code. It is not intended as an all-purpose copy\n * function, and has several limitations (see below).\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to `destination` an exception will be thrown.\n *\n *
\n *\n *
\n * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`\n * and on `destination`) will be ignored.\n *
\n *\n *
\n * `angular.copy` does not check if destination and source are of the same type. It's the\n * developer's responsibility to make sure they are compatible.\n *
\n *\n * @knownIssue\n * This is a non-exhaustive list of object types / features that are not handled correctly by\n * `angular.copy`. Note that since this functions is used by the change detection code, this\n * means binding or watching objects of these types (or that include these types) might not work\n * correctly.\n * - [`File`](https://developer.mozilla.org/docs/Web/API/File)\n * - [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)\n * - [`ImageData`](https://developer.mozilla.org/docs/Web/API/ImageData)\n * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)\n * - [`Set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\n * - [`WeakMap`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap)\n * - [`getter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)/\n * [`setter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)\n *\n * @param {*} source The source that will be used to make a copy. Can be any type, including\n * primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If provided,\n * must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n \n \n
\n
\n
\n
\n Gender: \n
\n \n \n
\n
form = {{user | json}}
\n
leader = {{leader | json}}
\n
\n
\n \n // Module: copyExample\n angular.\n module('copyExample', []).\n controller('ExampleController', ['$scope', function($scope) {\n $scope.leader = {};\n \n $scope.reset = function() {\n // Example with 1 argument\n $scope.user = angular.copy($scope.leader);\n };\n \n $scope.update = function(user) {\n // Example with 2 arguments\n angular.copy(user, $scope.leader);\n };\n \n $scope.reset();\n }]);\n \n
\n */\n function copy(source, destination, maxDepth) {\n var stackSource = [];\n var stackDest = [];\n maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;\n if (destination) {\n if (isTypedArray(destination) || isArrayBuffer(destination)) {\n throw ngMinErr('cpta', 'Can\\'t copy! TypedArray destination cannot be mutated.');\n }\n if (source === destination) {\n throw ngMinErr('cpi', 'Can\\'t copy! Source and destination are identical.');\n }\n\n // Empty the destination object\n if (isArray(destination)) {\n destination.length = 0;\n } else {\n forEach(destination, function (value, key) {\n if (key !== '$$hashKey') {\n delete destination[key];\n }\n });\n }\n stackSource.push(source);\n stackDest.push(destination);\n return copyRecurse(source, destination, maxDepth);\n }\n return copyElement(source, maxDepth);\n function copyRecurse(source, destination, maxDepth) {\n maxDepth--;\n if (maxDepth < 0) {\n return '...';\n }\n var h = destination.$$hashKey;\n var key;\n if (isArray(source)) {\n for (var i = 0, ii = source.length; i < ii; i++) {\n destination.push(copyElement(source[i], maxDepth));\n }\n } else if (isBlankObject(source)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in source) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n } else if (source && typeof source.hasOwnProperty === 'function') {\n // Slow path, which must rely on hasOwnProperty\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n } else {\n // Slowest path --- hasOwnProperty can't be called as a method\n for (key in source) {\n if (hasOwnProperty.call(source, key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n }\n setHashKey(destination, h);\n return destination;\n }\n function copyElement(source, maxDepth) {\n // Simple values\n if (!isObject(source)) {\n return source;\n }\n\n // Already copied values\n var index = stackSource.indexOf(source);\n if (index !== -1) {\n return stackDest[index];\n }\n if (isWindow(source) || isScope(source)) {\n throw ngMinErr('cpws', 'Can\\'t copy! Making copies of Window or Scope instances is not supported.');\n }\n var needsRecurse = false;\n var destination = copyType(source);\n if (destination === undefined) {\n destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));\n needsRecurse = true;\n }\n stackSource.push(source);\n stackDest.push(destination);\n return needsRecurse ? copyRecurse(source, destination, maxDepth) : destination;\n }\n function copyType(source) {\n switch (toString.call(source)) {\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object Int32Array]':\n case '[object Float32Array]':\n case '[object Float64Array]':\n case '[object Uint8Array]':\n case '[object Uint8ClampedArray]':\n case '[object Uint16Array]':\n case '[object Uint32Array]':\n return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);\n case '[object ArrayBuffer]':\n // Support: IE10\n if (!source.slice) {\n // If we're in this case we know the environment supports ArrayBuffer\n /* eslint-disable no-undef */\n var copied = new ArrayBuffer(source.byteLength);\n new Uint8Array(copied).set(new Uint8Array(source));\n /* eslint-enable */\n return copied;\n }\n return source.slice(0);\n case '[object Boolean]':\n case '[object Number]':\n case '[object String]':\n case '[object Date]':\n return new source.constructor(source.valueOf());\n case '[object RegExp]':\n var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);\n re.lastIndex = source.lastIndex;\n return re;\n case '[object Blob]':\n return new source.constructor([source], {\n type: source.type\n });\n }\n if (isFunction(source.cloneNode)) {\n return source.cloneNode(true);\n }\n }\n }\n\n // eslint-disable-next-line no-self-compare\n function simpleCompare(a, b) {\n return a === b || a !== a && b !== b;\n }\n\n /**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n *\n * @example\n \n \n
\n
\n

User 1

\n Name: \n Age: \n \n

User 2

\n Name: \n Age: \n \n
\n
\n \n
\n User 1:
{{user1 | json}}
\n User 2:
{{user2 | json}}
\n Equal:
{{result}}
\n
\n
\n
\n \n angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {\n $scope.user1 = {};\n $scope.user2 = {};\n $scope.compare = function() {\n $scope.result = angular.equals($scope.user1, $scope.user2);\n };\n }]);\n \n
\n */\n function equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n // eslint-disable-next-line no-self-compare\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1,\n t2 = typeof o2,\n length,\n key,\n keySet;\n if (t1 === t2 && t1 === 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) === o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n if (!isDate(o2)) return false;\n return simpleCompare(o1.getTime(), o2.getTime());\n } else if (isRegExp(o1)) {\n if (!isRegExp(o2)) return false;\n return o1.toString() === o2.toString();\n } else {\n if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) || isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n keySet = createMap();\n for (key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && key.charAt(0) !== '$' && isDefined(o2[key]) && !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n return false;\n }\n var csp = function () {\n if (!isDefined(csp.rules)) {\n var ngCspElement = window.document.querySelector('[ng-csp]') || window.document.querySelector('[data-ng-csp]');\n if (ngCspElement) {\n var ngCspAttribute = ngCspElement.getAttribute('ng-csp') || ngCspElement.getAttribute('data-ng-csp');\n csp.rules = {\n noUnsafeEval: !ngCspAttribute || ngCspAttribute.indexOf('no-unsafe-eval') !== -1,\n noInlineStyle: !ngCspAttribute || ngCspAttribute.indexOf('no-inline-style') !== -1\n };\n } else {\n csp.rules = {\n noUnsafeEval: noUnsafeEval(),\n noInlineStyle: false\n };\n }\n }\n return csp.rules;\n function noUnsafeEval() {\n try {\n // eslint-disable-next-line no-new, no-new-func\n new Function('');\n return false;\n } catch (e) {\n return true;\n }\n }\n };\n\n /**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since AngularJS looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n \n \n ...\n ...\n \n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n \n \n ...\n ...\n \n ```\n */\n var jq = function () {\n if (isDefined(jq.name_)) return jq.name_;\n var el;\n var i,\n ii = ngAttrPrefixes.length,\n prefix,\n name;\n for (i = 0; i < ii; ++i) {\n prefix = ngAttrPrefixes[i];\n el = window.document.querySelector('[' + prefix.replace(':', '\\\\:') + 'jq]');\n if (el) {\n name = el.getAttribute(prefix + 'jq');\n break;\n }\n }\n return jq.name_ = name;\n };\n function concat(array1, array2, index) {\n return array1.concat(slice.call(array2, index));\n }\n function sliceArgs(args, startIndex) {\n return slice.call(args, startIndex || 0);\n }\n\n /**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\n function bind(self, fn) {\n var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n if (isFunction(fn) && !(fn instanceof RegExp)) {\n return curryArgs.length ? function () {\n return arguments.length ? fn.apply(self, concat(curryArgs, arguments, 0)) : fn.apply(self, curryArgs);\n } : function () {\n return arguments.length ? fn.apply(self, arguments) : fn.call(self);\n };\n } else {\n // In IE, native methods are not functions so they cannot be bound (note: they don't need to be).\n return fn;\n }\n }\n function toJsonReplacer(key, value) {\n var val = value;\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && window.document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n return val;\n }\n\n /**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since AngularJS uses this notation internally.\n *\n * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n * @knownIssue\n *\n * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`\n * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the\n * `Date.prototype.toJSON` method as follows:\n *\n * ```\n * var _DatetoJSON = Date.prototype.toJSON;\n * Date.prototype.toJSON = function() {\n * try {\n * return _DatetoJSON.call(this);\n * } catch(e) {\n * if (e instanceof RangeError) {\n * return null;\n * }\n * throw e;\n * }\n * };\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14221 for more information.\n */\n function toJson(obj, pretty) {\n if (isUndefined(obj)) return undefined;\n if (!isNumber(pretty)) {\n pretty = pretty ? 2 : null;\n }\n return JSON.stringify(obj, toJsonReplacer, pretty);\n }\n\n /**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\n function fromJson(json) {\n return isString(json) ? JSON.parse(json) : json;\n }\n var ALL_COLONS = /:/g;\n function timezoneToOffset(timezone, fallback) {\n // Support: IE 9-11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(ALL_COLONS, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n }\n function addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n }\n function convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n }\n\n /**\n * @returns {string} Returns the string representation of the element.\n */\n function startingTag(element) {\n element = jqLite(element).clone().empty();\n var elemHtml = jqLite('
').append(element).html();\n try {\n return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) : elemHtml.match(/^(<[^>]+>)/)[1].replace(/^<([\\w-]+)/, function (match, nodeName) {\n return '<' + lowercase(nodeName);\n });\n } catch (e) {\n return lowercase(elemHtml);\n }\n }\n\n /////////////////////////////////////////////////\n\n /**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\n function tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component.\n }\n }\n\n /**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.}\n */\n function parseKeyValue( /**string*/keyValue) {\n var obj = {};\n forEach((keyValue || '').split('&'), function (keyValue) {\n var splitPoint, key, val;\n if (keyValue) {\n key = keyValue = keyValue.replace(/\\+/g, '%20');\n splitPoint = keyValue.indexOf('=');\n if (splitPoint !== -1) {\n key = keyValue.substring(0, splitPoint);\n val = keyValue.substring(splitPoint + 1);\n }\n key = tryDecodeURIComponent(key);\n if (isDefined(key)) {\n val = isDefined(val) ? tryDecodeURIComponent(val) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key], val];\n }\n }\n }\n });\n return obj;\n }\n function toKeyValue(obj) {\n var parts = [];\n forEach(obj, function (value, key) {\n if (isArray(value)) {\n forEach(value, function (arrayValue) {\n parts.push(encodeUriQuery(key, true) + (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n });\n } else {\n parts.push(encodeUriQuery(key, true) + (value === true ? '' : '=' + encodeUriQuery(value, true)));\n }\n });\n return parts.length ? parts.join('&') : '';\n }\n\n /**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\n function encodeUriSegment(val) {\n return encodeUriQuery(val, true).replace(/%26/gi, '&').replace(/%3D/gi, '=').replace(/%2B/gi, '+');\n }\n\n /**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\n function encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%3B/gi, ';').replace(/%20/g, pctEncodeSpaces ? '%20' : '+');\n }\n var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n function getNgAttribute(element, ngAttr) {\n var attr,\n i,\n ii = ngAttrPrefixes.length;\n for (i = 0; i < ii; ++i) {\n attr = ngAttrPrefixes[i] + ngAttr;\n if (isString(attr = element.getAttribute(attr))) {\n return attr;\n }\n }\n return null;\n }\n function allowAutoBootstrap(document) {\n var script = document.currentScript;\n if (!script) {\n // Support: IE 9-11 only\n // IE does not have `document.currentScript`\n return true;\n }\n\n // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack\n if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) {\n return false;\n }\n var attributes = script.attributes;\n var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')];\n return srcs.every(function (src) {\n if (!src) {\n return true;\n }\n if (!src.value) {\n return false;\n }\n var link = document.createElement('a');\n link.href = src.value;\n if (document.location.origin === link.origin) {\n // Same-origin resources are always allowed, even for banned URL schemes.\n return true;\n }\n // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web.\n // This is to prevent angular.js bundled with browser extensions from being used to bypass the\n // content security policy in web pages and other browser extensions.\n switch (link.protocol) {\n case 'http:':\n case 'https:':\n case 'ftp:':\n case 'blob:':\n case 'file:':\n case 'data:':\n return true;\n default:\n return false;\n }\n });\n }\n\n // Cached as it has to run during loading so that document.currentScript is available.\n var isAutoBootstrapAllowed = allowAutoBootstrap(window.document);\n\n /**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `` or `` tags.\n *\n * There are a few things to keep in mind when using `ngApp`:\n * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead.\n * - AngularJS applications cannot be nested within each other.\n * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.\n * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and\n * {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * @example\n *\n * ### Simple Usage\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n \n \n
\n I can add: {{a}} + {{b}} = {{ a+b }}\n
\n
\n \n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n \n
\n *\n * @example\n *\n * ### With `ngStrictDi`\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n \n \n
\n
\n I can add: {{a}} + {{b}} = {{ a+b }}\n \n

This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n

\n
\n \n
\n Name:
\n Hello, {{name}}!\n \n

This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n

\n
\n \n
\n I can add: {{a}} + {{b}} = {{ a+b }}\n \n

The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n

\n
\n
\n
\n \n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = 'World';\n }\n GoodController2.$inject = ['$scope'];\n \n \n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n \n
\n */\n function angularInit(element, bootstrap) {\n var appElement,\n module,\n config = {};\n\n // The element `element` has priority over any other element.\n forEach(ngAttrPrefixes, function (prefix) {\n var name = prefix + 'app';\n if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n appElement = element;\n module = element.getAttribute(name);\n }\n });\n forEach(ngAttrPrefixes, function (prefix) {\n var name = prefix + 'app';\n var candidate;\n if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n appElement = candidate;\n module = candidate.getAttribute(name);\n }\n });\n if (appElement) {\n if (!isAutoBootstrapAllowed) {\n window.console.error('AngularJS: disabling automatic bootstrap. \n * \n * \n * \n * ```\n *\n * @param {DOMElement} element DOM element which is the root of AngularJS application.\n * @param {Array=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\n function bootstrap(element, modules, config) {\n if (!isObject(config)) config = {};\n var defaultConfig = {\n strictDi: false\n };\n config = extend(defaultConfig, config);\n var doBootstrap = function () {\n element = jqLite(element);\n if (element.injector()) {\n var tag = element[0] === window.document ? 'document' : startingTag(element);\n // Encode angle brackets to prevent input from being sanitized to empty string #8683.\n throw ngMinErr('btstrpd', 'App already bootstrapped with this element \\'{0}\\'', tag.replace(//, '>'));\n }\n modules = modules || [];\n modules.unshift(['$provide', function ($provide) {\n $provide.value('$rootElement', element);\n }]);\n if (config.debugInfoEnabled) {\n // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n modules.push(['$compileProvider', function ($compileProvider) {\n $compileProvider.debugInfoEnabled(true);\n }]);\n }\n modules.unshift('ng');\n var injector = createInjector(modules, config.strictDi);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector', function bootstrapApply(scope, element, compile, injector) {\n scope.$apply(function () {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]);\n return injector;\n };\n var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n config.debugInfoEnabled = true;\n window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n }\n if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n return doBootstrap();\n }\n window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n angular.resumeBootstrap = function (extraModules) {\n forEach(extraModules, function (module) {\n modules.push(module);\n });\n return doBootstrap();\n };\n if (isFunction(angular.resumeDeferredBootstrap)) {\n angular.resumeDeferredBootstrap();\n }\n }\n\n /**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\n function reloadWithDebugInfo() {\n window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n window.location.reload();\n }\n\n /**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of AngularJS on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of AngularJS application.\n */\n function getTestability(rootElement) {\n var injector = angular.element(rootElement).injector();\n if (!injector) {\n throw ngMinErr('test', 'no injector found for element argument to getTestability');\n }\n return injector.get('$$testability');\n }\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n function snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function (letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n var bindJQueryFired = false;\n function bindJQuery() {\n var originalCleanData;\n if (bindJQueryFired) {\n return;\n }\n\n // bind to jQuery if present;\n var jqName = jq();\n jQuery = isUndefined(jqName) ? window.jQuery :\n // use jQuery (if present)\n !jqName ? undefined :\n // use jqLite\n window[jqName]; // use jQuery specified by `ngJq`\n\n // Use jQuery if it exists with proper functionality, otherwise default to us.\n // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support.\n // AngularJS 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n // versions. It will not work for sure with jQuery <1.7, though.\n if (jQuery && jQuery.fn.on) {\n jqLite = jQuery;\n extend(jQuery.fn, {\n scope: JQLitePrototype.scope,\n isolateScope: JQLitePrototype.isolateScope,\n controller: /** @type {?} */JQLitePrototype.controller,\n injector: JQLitePrototype.injector,\n inheritedData: JQLitePrototype.inheritedData\n });\n } else {\n jqLite = JQLite;\n }\n\n // All nodes removed from the DOM via various jqLite/jQuery APIs like .remove()\n // are passed through jqLite/jQuery.cleanData. Monkey-patch this method to fire\n // the $destroy event on all removed nodes.\n originalCleanData = jqLite.cleanData;\n jqLite.cleanData = function (elems) {\n var events;\n for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n events = (jqLite._data(elem) || {}).events;\n if (events && events.$destroy) {\n jqLite(elem).triggerHandler('$destroy');\n }\n }\n originalCleanData(elems);\n };\n angular.element = jqLite;\n\n // Prevent double-proxying.\n bindJQueryFired = true;\n }\n\n /**\n * @ngdoc function\n * @name angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement\n * @module ng\n * @kind function\n *\n * @description\n * Restores the pre-1.8 behavior of jqLite that turns XHTML-like strings like\n * `
` to `
` instead of `
`.\n * The new behavior is a security fix. Thus, if you need to call this function, please try to adjust\n * your code for this change and remove your use of this function as soon as possible.\n \n * Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read the\n * [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details\n * about the workarounds.\n */\n function UNSAFE_restoreLegacyJqLiteXHTMLReplacement() {\n JQLite.legacyXHTMLReplacement = true;\n }\n\n /**\n * throw error if the argument is falsy.\n */\n function assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', 'Argument \\'{0}\\' is {1}', name || '?', reason || 'required');\n }\n return arg;\n }\n function assertArgFn(arg, name, acceptArrayAnnotation) {\n if (acceptArrayAnnotation && isArray(arg)) {\n arg = arg[arg.length - 1];\n }\n assertArg(isFunction(arg), name, 'not a function, got ' + (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n return arg;\n }\n\n /**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\n function assertNotHasOwnProperty(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n }\n\n /**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n //TODO(misko): this function needs to be removed\n function getter(obj, path, bindFnToScope) {\n if (!path) return obj;\n var keys = path.split('.');\n var key;\n var lastInstance = obj;\n var len = keys.length;\n for (var i = 0; i < len; i++) {\n key = keys[i];\n if (obj) {\n obj = (lastInstance = obj)[key];\n }\n }\n if (!bindFnToScope && isFunction(obj)) {\n return bind(lastInstance, obj);\n }\n return obj;\n }\n\n /**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\n function getBlockNodes(nodes) {\n // TODO(perf): update `nodes` instead of creating a new object?\n var node = nodes[0];\n var endNode = nodes[nodes.length - 1];\n var blockNodes;\n for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n if (blockNodes || nodes[i] !== node) {\n if (!blockNodes) {\n blockNodes = jqLite(slice.call(nodes, 0, i));\n }\n blockNodes.push(node);\n }\n }\n return blockNodes || nodes;\n }\n\n /**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\n function createMap() {\n return Object.create(null);\n }\n function stringify(value) {\n if (value == null) {\n // null || undefined\n return '';\n }\n switch (typeof value) {\n case 'string':\n break;\n case 'number':\n value = '' + value;\n break;\n default:\n if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {\n value = value.toString();\n } else {\n value = toJson(value);\n }\n }\n return value;\n }\n var NODE_TYPE_ELEMENT = 1;\n var NODE_TYPE_ATTRIBUTE = 2;\n var NODE_TYPE_TEXT = 3;\n var NODE_TYPE_COMMENT = 8;\n var NODE_TYPE_DOCUMENT = 9;\n var NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n /**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring AngularJS {@link angular.module modules}.\n */\n\n function setupModuleLoader(window) {\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n return ensure(angular, 'module', function () {\n /** @type {Object.} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving AngularJS\n * modules.\n * All modules (AngularJS core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n var info = {};\n var assertNotHasOwnProperty = function (name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function () {\n if (!requires) {\n throw $injectorMinErr('nomod', 'Module \\'{0}\\' is not available! You either misspelled ' + 'the module name or forgot to load it. If registering a module ensure that you ' + 'specify the dependencies as the second argument.', name);\n }\n\n /** @type {!Array.>} */\n var invokeQueue = [];\n\n /** @type {!Array.} */\n var configBlocks = [];\n\n /** @type {!Array.} */\n var runBlocks = [];\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n /**\n * @ngdoc method\n * @name angular.Module#info\n * @module ng\n *\n * @param {Object=} info Information about the module\n * @returns {Object|Module} The current info object for this module if called as a getter,\n * or `this` if called as a setter.\n *\n * @description\n * Read and write custom information about this module.\n * For example you could put the version of the module in here.\n *\n * ```js\n * angular.module('myModule', []).info({ version: '1.0.0' });\n * ```\n *\n * The version could then be read back out by accessing the module elsewhere:\n *\n * ```\n * var version = angular.module('myModule').info().version;\n * ```\n *\n * You can also retrieve this information during runtime via the\n * {@link $injector#modules `$injector.modules`} property:\n *\n * ```js\n * var version = $injector.modules['myModule'].info().version;\n * ```\n */\n info: function (value) {\n if (isDefined(value)) {\n if (!isObject(value)) throw ngMinErr('aobj', 'Argument \\'{0}\\' must be an object', 'value');\n info = value;\n return this;\n }\n return info;\n },\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} name The name of the service to decorate.\n * @param {Function} decorFn This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid AngularJS expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n *
\n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
\n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match ``),\n * or an object map of components where the keys are the names and the values are the component definition objects.\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to configure services by injecting their\n * {@link angular.Module#provider `providers`}, e.g. for adding routes to the\n * {@link ngRoute.$routeProvider $routeProvider}.\n *\n * Note that you can only inject {@link angular.Module#provider `providers`} and\n * {@link angular.Module#constant `constants`} into this function.\n *\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function (block) {\n runBlocks.push(block);\n return this;\n }\n };\n if (configFn) {\n config(configFn);\n }\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function () {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method, queue) {\n if (!queue) queue = invokeQueue;\n return function (recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n queue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n }\n\n /* global shallowCopy: true */\n\n /**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\n function shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n return dst || src;\n }\n\n /* exported toDebugString */\n\n function serializeObject(obj, maxDepth) {\n var seen = [];\n\n // There is no direct way to stringify object until reaching a specific depth\n // and a very deep object can cause a performance issue, so we copy the object\n // based on this specific depth and then stringify it.\n if (isValidObjectMaxDepth(maxDepth)) {\n // This file is also included in `angular-loader`, so `copy()` might not always be available in\n // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.\n obj = angular.copy(obj, null, maxDepth);\n }\n return JSON.stringify(obj, function (key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n if (seen.indexOf(val) >= 0) return '...';\n seen.push(val);\n }\n return val;\n });\n }\n function toDebugString(obj, maxDepth) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj, maxDepth);\n }\n return obj;\n }\n\n /* global angularModule: true,\n version: true,\n \n $CompileProvider,\n \n htmlAnchorDirective,\n inputDirective,\n hiddenInputBrowserCacheDirective,\n formDirective,\n scriptDirective,\n selectDirective,\n optionDirective,\n ngBindDirective,\n ngBindHtmlDirective,\n ngBindTemplateDirective,\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective,\n ngCloakDirective,\n ngControllerDirective,\n ngFormDirective,\n ngHideDirective,\n ngIfDirective,\n ngIncludeDirective,\n ngIncludeFillContentDirective,\n ngInitDirective,\n ngNonBindableDirective,\n ngPluralizeDirective,\n ngRefDirective,\n ngRepeatDirective,\n ngShowDirective,\n ngStyleDirective,\n ngSwitchDirective,\n ngSwitchWhenDirective,\n ngSwitchDefaultDirective,\n ngOptionsDirective,\n ngTranscludeDirective,\n ngModelDirective,\n ngListDirective,\n ngChangeDirective,\n patternDirective,\n patternDirective,\n requiredDirective,\n requiredDirective,\n minlengthDirective,\n minlengthDirective,\n maxlengthDirective,\n maxlengthDirective,\n ngValueDirective,\n ngModelOptionsDirective,\n ngAttributeAliasDirectives,\n ngEventDirectives,\n \n $AnchorScrollProvider,\n $AnimateProvider,\n $CoreAnimateCssProvider,\n $$CoreAnimateJsProvider,\n $$CoreAnimateQueueProvider,\n $$AnimateRunnerFactoryProvider,\n $$AnimateAsyncRunFactoryProvider,\n $BrowserProvider,\n $CacheFactoryProvider,\n $ControllerProvider,\n $DateProvider,\n $DocumentProvider,\n $$IsDocumentHiddenProvider,\n $ExceptionHandlerProvider,\n $FilterProvider,\n $$ForceReflowProvider,\n $InterpolateProvider,\n $$IntervalFactoryProvider,\n $IntervalProvider,\n $HttpProvider,\n $HttpParamSerializerProvider,\n $HttpParamSerializerJQLikeProvider,\n $HttpBackendProvider,\n $xhrFactoryProvider,\n $jsonpCallbacksProvider,\n $LocationProvider,\n $LogProvider,\n $$MapProvider,\n $ParseProvider,\n $RootScopeProvider,\n $QProvider,\n $$QProvider,\n $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $$TaskTrackerFactoryProvider,\n $TemplateCacheProvider,\n $TemplateRequestProvider,\n $$TestabilityProvider,\n $TimeoutProvider,\n $$RAFProvider,\n $WindowProvider,\n $$jqLiteProvider,\n $$CookieReaderProvider\n */\n\n /**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version.\n *\n * This object has the following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\n var version = {\n // These placeholder strings will be replaced by grunt's `build` task.\n // They need to be double- or single-quoted.\n full: '1.8.3',\n major: 1,\n minor: 8,\n dot: 3,\n codeName: 'ultimate-farewell'\n };\n function publishExternalAPI(angular) {\n extend(angular, {\n 'errorHandlingConfig': errorHandlingConfig,\n 'bootstrap': bootstrap,\n 'copy': copy,\n 'extend': extend,\n 'merge': merge,\n 'equals': equals,\n 'element': jqLite,\n 'forEach': forEach,\n 'injector': createInjector,\n 'noop': noop,\n 'bind': bind,\n 'toJson': toJson,\n 'fromJson': fromJson,\n 'identity': identity,\n 'isUndefined': isUndefined,\n 'isDefined': isDefined,\n 'isString': isString,\n 'isFunction': isFunction,\n 'isObject': isObject,\n 'isNumber': isNumber,\n 'isElement': isElement,\n 'isArray': isArray,\n 'version': version,\n 'isDate': isDate,\n 'callbacks': {\n $$counter: 0\n },\n 'getTestability': getTestability,\n 'reloadWithDebugInfo': reloadWithDebugInfo,\n 'UNSAFE_restoreLegacyJqLiteXHTMLReplacement': UNSAFE_restoreLegacyJqLiteXHTMLReplacement,\n '$$minErr': minErr,\n '$$csp': csp,\n '$$encodeUriSegment': encodeUriSegment,\n '$$encodeUriQuery': encodeUriQuery,\n '$$lowercase': lowercase,\n '$$stringify': stringify,\n '$$uppercase': uppercase\n });\n angularModule = setupModuleLoader(window);\n angularModule('ng', ['ngLocale'], ['$provide', function ngModule($provide) {\n // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n $provide.provider({\n $$sanitizeUri: $$SanitizeUriProvider\n });\n $provide.provider('$compile', $CompileProvider).directive({\n a: htmlAnchorDirective,\n input: inputDirective,\n textarea: inputDirective,\n form: formDirective,\n script: scriptDirective,\n select: selectDirective,\n option: optionDirective,\n ngBind: ngBindDirective,\n ngBindHtml: ngBindHtmlDirective,\n ngBindTemplate: ngBindTemplateDirective,\n ngClass: ngClassDirective,\n ngClassEven: ngClassEvenDirective,\n ngClassOdd: ngClassOddDirective,\n ngCloak: ngCloakDirective,\n ngController: ngControllerDirective,\n ngForm: ngFormDirective,\n ngHide: ngHideDirective,\n ngIf: ngIfDirective,\n ngInclude: ngIncludeDirective,\n ngInit: ngInitDirective,\n ngNonBindable: ngNonBindableDirective,\n ngPluralize: ngPluralizeDirective,\n ngRef: ngRefDirective,\n ngRepeat: ngRepeatDirective,\n ngShow: ngShowDirective,\n ngStyle: ngStyleDirective,\n ngSwitch: ngSwitchDirective,\n ngSwitchWhen: ngSwitchWhenDirective,\n ngSwitchDefault: ngSwitchDefaultDirective,\n ngOptions: ngOptionsDirective,\n ngTransclude: ngTranscludeDirective,\n ngModel: ngModelDirective,\n ngList: ngListDirective,\n ngChange: ngChangeDirective,\n pattern: patternDirective,\n ngPattern: patternDirective,\n required: requiredDirective,\n ngRequired: requiredDirective,\n minlength: minlengthDirective,\n ngMinlength: minlengthDirective,\n maxlength: maxlengthDirective,\n ngMaxlength: maxlengthDirective,\n ngValue: ngValueDirective,\n ngModelOptions: ngModelOptionsDirective\n }).directive({\n ngInclude: ngIncludeFillContentDirective,\n input: hiddenInputBrowserCacheDirective\n }).directive(ngAttributeAliasDirectives).directive(ngEventDirectives);\n $provide.provider({\n $anchorScroll: $AnchorScrollProvider,\n $animate: $AnimateProvider,\n $animateCss: $CoreAnimateCssProvider,\n $$animateJs: $$CoreAnimateJsProvider,\n $$animateQueue: $$CoreAnimateQueueProvider,\n $$AnimateRunner: $$AnimateRunnerFactoryProvider,\n $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,\n $browser: $BrowserProvider,\n $cacheFactory: $CacheFactoryProvider,\n $controller: $ControllerProvider,\n $document: $DocumentProvider,\n $$isDocumentHidden: $$IsDocumentHiddenProvider,\n $exceptionHandler: $ExceptionHandlerProvider,\n $filter: $FilterProvider,\n $$forceReflow: $$ForceReflowProvider,\n $interpolate: $InterpolateProvider,\n $interval: $IntervalProvider,\n $$intervalFactory: $$IntervalFactoryProvider,\n $http: $HttpProvider,\n $httpParamSerializer: $HttpParamSerializerProvider,\n $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,\n $httpBackend: $HttpBackendProvider,\n $xhrFactory: $xhrFactoryProvider,\n $jsonpCallbacks: $jsonpCallbacksProvider,\n $location: $LocationProvider,\n $log: $LogProvider,\n $parse: $ParseProvider,\n $rootScope: $RootScopeProvider,\n $q: $QProvider,\n $$q: $$QProvider,\n $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $$taskTrackerFactory: $$TaskTrackerFactoryProvider,\n $templateCache: $TemplateCacheProvider,\n $templateRequest: $TemplateRequestProvider,\n $$testability: $$TestabilityProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider,\n $$rAF: $$RAFProvider,\n $$jqLite: $$jqLiteProvider,\n $$Map: $$MapProvider,\n $$cookieReader: $$CookieReaderProvider\n });\n }]).info({\n angularVersion: '1.8.3'\n });\n }\n\n /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n /* global\n JQLitePrototype: true,\n BOOLEAN_ATTR: true,\n ALIASED_ATTR: true\n */\n\n //////////////////////////////////\n //JQLite\n //////////////////////////////////\n\n /**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to AngularJS's built-in subset of jQuery, called \"jQuery lite\" or **jqLite**.\n *\n * jqLite is a tiny, API-compatible subset of jQuery that allows\n * AngularJS to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most\n * commonly needed functionality with the goal of having a very small footprint.\n *\n * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the\n * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a\n * specific version of jQuery if multiple versions exist on the page.\n *\n *
**Note:** All element references in AngularJS are always wrapped with jQuery or\n * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.
\n *\n *
**Note:** Keep in mind that this function will not find elements\n * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`\n * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.
\n *\n * ## AngularJS's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/) - Contrary to jQuery, this doesn't clone elements\n * so will not work correctly when invoked on a jqLite object containing more than one DOM node\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) (_deprecated_, use [`on()`](http://api.jquery.com/on/)) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.\n * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/) (_deprecated_, use `angular.element(callback)` instead of `angular.element(document).ready(callback)`)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - Does not support multiple attributes\n * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers\n * - [`unbind()`](http://api.jquery.com/unbind/) (_deprecated_, use [`off()`](http://api.jquery.com/off/)) - Does not support namespaces or event object as parameter\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * jqLite also provides a method restoring pre-1.8 insecure treatment of XHTML-like tags.\n * This legacy behavior turns input like `
` to `
`\n * instead of `
` like version 1.8 & newer do. To restore it, invoke:\n * ```js\n * angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement();\n * ```\n * Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read the\n * [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details\n * about the workarounds.\n *\n * ## jQuery/jqLite Extras\n * AngularJS also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM\n * element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n * retrieves controller associated with the `ngController` directive. If `name` is provided as\n * camelCase directive name, then the controller for this directive will be retrieved (e.g.\n * `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n * be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n * current element. This getter should be used only on elements that contain a directive which starts a new isolate\n * scope. Calling `scope()` on this element always returns the original non-isolate scope.\n * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n * parent element is reached.\n *\n * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See\n * https://github.com/angular/angular.js/issues/14251 for more information.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\n JQLite.expando = 'ng339';\n var jqCache = JQLite.cache = {},\n jqId = 1;\n\n /*\n * !!! This is an undocumented \"private\" function !!!\n */\n JQLite._data = function (node) {\n //jQuery always returns an object on cache miss\n return this.cache[node[this.expando]] || {};\n };\n function jqNextId() {\n return ++jqId;\n }\n var DASH_LOWERCASE_REGEXP = /-([a-z])/g;\n var MS_HACK_REGEXP = /^-ms-/;\n var MOUSE_EVENT_MAP = {\n mouseleave: 'mouseout',\n mouseenter: 'mouseover'\n };\n var jqLiteMinErr = minErr('jqLite');\n\n /**\n * Converts kebab-case to camelCase.\n * There is also a special case for the ms prefix starting with a lowercase letter.\n * @param name Name to normalize\n */\n function cssKebabToCamel(name) {\n return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-'));\n }\n function fnCamelCaseReplace(all, letter) {\n return letter.toUpperCase();\n }\n\n /**\n * Converts kebab-case to camelCase.\n * @param name Name to normalize\n */\n function kebabToCamel(name) {\n return name.replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace);\n }\n var SINGLE_TAG_REGEXP = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\n var HTML_REGEXP = /<|&#?\\w+;/;\n var TAG_NAME_REGEXP = /<([\\w:-]+)/;\n var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;\n\n // Table parts need to be wrapped with `` or they're\n // stripped to their contents when put in a div.\n // XHTML parsers do not magically insert elements in the\n // same way that tag soup parsers do, so we cannot shorten\n // this by omitting or other required elements.\n var wrapMap = {\n thead: ['table'],\n col: ['colgroup', 'table'],\n tr: ['tbody', 'table'],\n td: ['tr', 'tbody', 'table']\n };\n wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\n wrapMap.th = wrapMap.td;\n\n // Support: IE <10 only\n // IE 9 requires an option wrapper & it needs to have the whole table structure\n // set up in advance; assigning `\"\"` to `tr.innerHTML` doesn't work, etc.\n var wrapMapIE9 = {\n option: [1, ''],\n _default: [0, '', '']\n };\n for (var key in wrapMap) {\n var wrapMapValueClosing = wrapMap[key];\n var wrapMapValue = wrapMapValueClosing.slice().reverse();\n wrapMapIE9[key] = [wrapMapValue.length, '<' + wrapMapValue.join('><') + '>', ''];\n }\n wrapMapIE9.optgroup = wrapMapIE9.option;\n function jqLiteIsTextNode(html) {\n return !HTML_REGEXP.test(html);\n }\n function jqLiteAcceptsData(node) {\n // The window object can accept data but has no nodeType\n // Otherwise we are only interested in elements (1) and documents (9)\n var nodeType = node.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n }\n function jqLiteHasData(node) {\n for (var key in jqCache[node.ng339]) {\n return true;\n }\n return false;\n }\n function jqLiteBuildFragment(html, context) {\n var tmp,\n tag,\n wrap,\n finalHtml,\n fragment = context.createDocumentFragment(),\n nodes = [],\n i;\n if (jqLiteIsTextNode(html)) {\n // Convert non-html into a text node\n nodes.push(context.createTextNode(html));\n } else {\n // Convert html into DOM nodes\n tmp = fragment.appendChild(context.createElement('div'));\n tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase();\n finalHtml = JQLite.legacyXHTMLReplacement ? html.replace(XHTML_TAG_REGEXP, '<$1>') : html;\n if (msie < 10) {\n wrap = wrapMapIE9[tag] || wrapMapIE9._default;\n tmp.innerHTML = wrap[1] + finalHtml + wrap[2];\n\n // Descend through wrappers to the right content\n i = wrap[0];\n while (i--) {\n tmp = tmp.firstChild;\n }\n } else {\n wrap = wrapMap[tag] || [];\n\n // Create wrappers & descend into them\n i = wrap.length;\n while (--i > -1) {\n tmp.appendChild(window.document.createElement(wrap[i]));\n tmp = tmp.firstChild;\n }\n tmp.innerHTML = finalHtml;\n }\n nodes = concat(nodes, tmp.childNodes);\n tmp = fragment.firstChild;\n tmp.textContent = '';\n }\n\n // Remove wrapper from fragment\n fragment.textContent = '';\n fragment.innerHTML = ''; // Clear inner HTML\n forEach(nodes, function (node) {\n fragment.appendChild(node);\n });\n return fragment;\n }\n function jqLiteParseHTML(html, context) {\n context = context || window.document;\n var parsed;\n if (parsed = SINGLE_TAG_REGEXP.exec(html)) {\n return [context.createElement(parsed[1])];\n }\n if (parsed = jqLiteBuildFragment(html, context)) {\n return parsed.childNodes;\n }\n return [];\n }\n function jqLiteWrapNode(node, wrapper) {\n var parent = node.parentNode;\n if (parent) {\n parent.replaceChild(wrapper, node);\n }\n wrapper.appendChild(node);\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var jqLiteContains = window.Node.prototype.contains || /** @this */function (arg) {\n // eslint-disable-next-line no-bitwise\n return !!(this.compareDocumentPosition(arg) & 16);\n };\n\n /////////////////////////////////////////////\n function JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n var argIsString;\n if (isString(element)) {\n element = trim(element);\n argIsString = true;\n }\n if (!(this instanceof JQLite)) {\n if (argIsString && element.charAt(0) !== '<') {\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n }\n return new JQLite(element);\n }\n if (argIsString) {\n jqLiteAddNodes(this, jqLiteParseHTML(element));\n } else if (isFunction(element)) {\n jqLiteReady(element);\n } else {\n jqLiteAddNodes(this, element);\n }\n }\n function jqLiteClone(element) {\n return element.cloneNode(true);\n }\n function jqLiteDealoc(element, onlyDescendants) {\n if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]);\n if (element.querySelectorAll) {\n jqLite.cleanData(element.querySelectorAll('*'));\n }\n }\n function isEmptyObject(obj) {\n var name;\n for (name in obj) {\n return false;\n }\n return true;\n }\n function removeIfEmptyData(element) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n var events = expandoStore && expandoStore.events;\n var data = expandoStore && expandoStore.data;\n if ((!data || isEmptyObject(data)) && (!events || isEmptyObject(events))) {\n delete jqCache[expandoId];\n element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n }\n }\n function jqLiteOff(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var handle = expandoStore && expandoStore.handle;\n if (!handle) return; //no listeners registered\n\n if (!type) {\n for (type in events) {\n if (type !== '$destroy') {\n element.removeEventListener(type, handle);\n }\n delete events[type];\n }\n } else {\n var removeHandler = function (type) {\n var listenerFns = events[type];\n if (isDefined(fn)) {\n arrayRemove(listenerFns || [], fn);\n }\n if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {\n element.removeEventListener(type, handle);\n delete events[type];\n }\n };\n forEach(type.split(' '), function (type) {\n removeHandler(type);\n if (MOUSE_EVENT_MAP[type]) {\n removeHandler(MOUSE_EVENT_MAP[type]);\n }\n });\n }\n removeIfEmptyData(element);\n }\n function jqLiteRemoveData(element, name) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n if (expandoStore) {\n if (name) {\n delete expandoStore.data[name];\n } else {\n expandoStore.data = {};\n }\n removeIfEmptyData(element);\n }\n }\n function jqLiteExpandoStore(element, createIfNecessary) {\n var expandoId = element.ng339,\n expandoStore = expandoId && jqCache[expandoId];\n if (createIfNecessary && !expandoStore) {\n element.ng339 = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {\n events: {},\n data: {},\n handle: undefined\n };\n }\n return expandoStore;\n }\n function jqLiteData(element, key, value) {\n if (jqLiteAcceptsData(element)) {\n var prop;\n var isSimpleSetter = isDefined(value);\n var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n var massGetter = !key;\n var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n var data = expandoStore && expandoStore.data;\n if (isSimpleSetter) {\n // data('key', value)\n data[kebabToCamel(key)] = value;\n } else {\n if (massGetter) {\n // data()\n return data;\n } else {\n if (isSimpleGetter) {\n // data('key')\n // don't force creation of expandoStore if it doesn't exist yet\n return data && data[kebabToCamel(key)];\n } else {\n // mass-setter: data({key1: val1, key2: val2})\n for (prop in key) {\n data[kebabToCamel(prop)] = key[prop];\n }\n }\n }\n }\n }\n }\n function jqLiteHasClass(element, selector) {\n if (!element.getAttribute) return false;\n return (' ' + (element.getAttribute('class') || '') + ' ').replace(/[\\n\\t]/g, ' ').indexOf(' ' + selector + ' ') > -1;\n }\n function jqLiteRemoveClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ').replace(/[\\n\\t]/g, ' ');\n var newClasses = existingClasses;\n forEach(cssClasses.split(' '), function (cssClass) {\n cssClass = trim(cssClass);\n newClasses = newClasses.replace(' ' + cssClass + ' ', ' ');\n });\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\n }\n }\n }\n function jqLiteAddClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ').replace(/[\\n\\t]/g, ' ');\n var newClasses = existingClasses;\n forEach(cssClasses.split(' '), function (cssClass) {\n cssClass = trim(cssClass);\n if (newClasses.indexOf(' ' + cssClass + ' ') === -1) {\n newClasses += cssClass + ' ';\n }\n });\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\n }\n }\n }\n function jqLiteAddNodes(root, elements) {\n // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n if (elements) {\n // if a Node (the most common case)\n if (elements.nodeType) {\n root[root.length++] = elements;\n } else {\n var length = elements.length;\n\n // if an Array or NodeList and not a Window\n if (typeof length === 'number' && elements.window !== elements) {\n if (length) {\n for (var i = 0; i < length; i++) {\n root[root.length++] = elements[i];\n }\n }\n } else {\n root[root.length++] = elements;\n }\n }\n }\n }\n function jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n }\n function jqLiteInheritedData(element, name, value) {\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if (element.nodeType === NODE_TYPE_DOCUMENT) {\n element = element.documentElement;\n }\n var names = isArray(name) ? name : [name];\n while (element) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n if (isDefined(value = jqLite.data(element, names[i]))) return value;\n }\n\n // If dealing with a document fragment node with a host element, and no parent, use the host\n // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n // to lookup parent controllers.\n element = element.parentNode || element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host;\n }\n }\n function jqLiteEmpty(element) {\n jqLiteDealoc(element, true);\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n }\n function jqLiteRemove(element, keepData) {\n if (!keepData) jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n }\n function jqLiteDocumentLoaded(action, win) {\n win = win || window;\n if (win.document.readyState === 'complete') {\n // Force the action to be run async for consistent behavior\n // from the action's point of view\n // i.e. it will definitely not be in a $apply\n win.setTimeout(action);\n } else {\n // No need to unbind this handler as load is only ever called once\n jqLite(win).on('load', action);\n }\n }\n function jqLiteReady(fn) {\n function trigger() {\n window.document.removeEventListener('DOMContentLoaded', trigger);\n window.removeEventListener('load', trigger);\n fn();\n }\n\n // check if document is already loaded\n if (window.document.readyState === 'complete') {\n window.setTimeout(fn);\n } else {\n // We can not use jqLite since we are not done loading and jQuery could be loaded later.\n\n // Works for modern browsers and IE9\n window.document.addEventListener('DOMContentLoaded', trigger);\n\n // Fallback to window.onload for others\n window.addEventListener('load', trigger);\n }\n }\n\n //////////////////////////////////////////\n // Functions which are declared directly.\n //////////////////////////////////////////\n var JQLitePrototype = JQLite.prototype = {\n ready: jqLiteReady,\n toString: function () {\n var value = [];\n forEach(this, function (e) {\n value.push('' + e);\n });\n return '[' + value.join(', ') + ']';\n },\n eq: function (index) {\n return index >= 0 ? jqLite(this[index]) : jqLite(this[this.length + index]);\n },\n length: 0,\n push: push,\n sort: [].sort,\n splice: [].splice\n };\n\n //////////////////////////////////////////\n // Functions iterating getter/setters.\n // these functions return self on setter and\n // value on get.\n //////////////////////////////////////////\n var BOOLEAN_ATTR = {};\n forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function (value) {\n BOOLEAN_ATTR[lowercase(value)] = value;\n });\n var BOOLEAN_ELEMENTS = {};\n forEach('input,select,option,textarea,button,form,details'.split(','), function (value) {\n BOOLEAN_ELEMENTS[value] = true;\n });\n var ALIASED_ATTR = {\n 'ngMinlength': 'minlength',\n 'ngMaxlength': 'maxlength',\n 'ngMin': 'min',\n 'ngMax': 'max',\n 'ngPattern': 'pattern',\n 'ngStep': 'step'\n };\n function getBooleanAttrName(element, name) {\n // check dom last since we will most likely fail on name\n var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n // booleanAttr is here twice to minimize DOM access\n return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n }\n function getAliasedAttrName(name) {\n return ALIASED_ATTR[name];\n }\n forEach({\n data: jqLiteData,\n removeData: jqLiteRemoveData,\n hasData: jqLiteHasData,\n cleanData: function jqLiteCleanData(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n jqLiteRemoveData(nodes[i]);\n jqLiteOff(nodes[i]);\n }\n }\n }, function (fn, name) {\n JQLite[name] = fn;\n });\n forEach({\n data: jqLiteData,\n inheritedData: jqLiteInheritedData,\n scope: function (element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n },\n isolateScope: function (element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n },\n controller: jqLiteController,\n injector: function (element) {\n return jqLiteInheritedData(element, '$injector');\n },\n removeAttr: function (element, name) {\n element.removeAttribute(name);\n },\n hasClass: jqLiteHasClass,\n css: function (element, name, value) {\n name = cssKebabToCamel(name);\n if (isDefined(value)) {\n element.style[name] = value;\n } else {\n return element.style[name];\n }\n },\n attr: function (element, name, value) {\n var ret;\n var nodeType = element.nodeType;\n if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT || !element.getAttribute) {\n return;\n }\n var lowercasedName = lowercase(name);\n var isBooleanAttr = BOOLEAN_ATTR[lowercasedName];\n if (isDefined(value)) {\n // setter\n\n if (value === null || value === false && isBooleanAttr) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, isBooleanAttr ? lowercasedName : value);\n }\n } else {\n // getter\n\n ret = element.getAttribute(name);\n if (isBooleanAttr && ret !== null) {\n ret = lowercasedName;\n }\n // Normalize non-existing attributes to undefined (as jQuery).\n return ret === null ? undefined : ret;\n }\n },\n prop: function (element, name, value) {\n if (isDefined(value)) {\n element[name] = value;\n } else {\n return element[name];\n }\n },\n text: function () {\n getText.$dv = '';\n return getText;\n function getText(element, value) {\n if (isUndefined(value)) {\n var nodeType = element.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT ? element.textContent : '';\n }\n element.textContent = value;\n }\n }(),\n val: function (element, value) {\n if (isUndefined(value)) {\n if (element.multiple && nodeName_(element) === 'select') {\n var result = [];\n forEach(element.options, function (option) {\n if (option.selected) {\n result.push(option.value || option.text);\n }\n });\n return result;\n }\n return element.value;\n }\n element.value = value;\n },\n html: function (element, value) {\n if (isUndefined(value)) {\n return element.innerHTML;\n }\n jqLiteDealoc(element, true);\n element.innerHTML = value;\n },\n empty: jqLiteEmpty\n }, function (fn, name) {\n /**\n * Properties: writes return selection, reads return first value\n */\n JQLite.prototype[name] = function (arg1, arg2) {\n var i, key;\n var nodeCount = this.length;\n\n // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n // in a way that survives minification.\n // jqLiteEmpty takes no arguments but is a setter.\n if (fn !== jqLiteEmpty && isUndefined(fn.length === 2 && fn !== jqLiteHasClass && fn !== jqLiteController ? arg1 : arg2)) {\n if (isObject(arg1)) {\n // we are a write, but the object properties are the key/values\n for (i = 0; i < nodeCount; i++) {\n if (fn === jqLiteData) {\n // data() takes the whole object in jQuery\n fn(this[i], arg1);\n } else {\n for (key in arg1) {\n fn(this[i], key, arg1[key]);\n }\n }\n }\n // return self for chaining\n return this;\n } else {\n // we are a read, so read the first child.\n // TODO: do we still need this?\n var value = fn.$dv;\n // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n var jj = isUndefined(value) ? Math.min(nodeCount, 1) : nodeCount;\n for (var j = 0; j < jj; j++) {\n var nodeValue = fn(this[j], arg1, arg2);\n value = value ? value + nodeValue : nodeValue;\n }\n return value;\n }\n } else {\n // we are a write, so apply to all children\n for (i = 0; i < nodeCount; i++) {\n fn(this[i], arg1, arg2);\n }\n // return self for chaining\n return this;\n }\n };\n });\n function createEventHandler(element, events) {\n var eventHandler = function (event, type) {\n // jQuery specific api\n event.isDefaultPrevented = function () {\n return event.defaultPrevented;\n };\n var eventFns = events[type || event.type];\n var eventFnsLength = eventFns ? eventFns.length : 0;\n if (!eventFnsLength) return;\n if (isUndefined(event.immediatePropagationStopped)) {\n var originalStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function () {\n event.immediatePropagationStopped = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n if (originalStopImmediatePropagation) {\n originalStopImmediatePropagation.call(event);\n }\n };\n }\n event.isImmediatePropagationStopped = function () {\n return event.immediatePropagationStopped === true;\n };\n\n // Some events have special handlers that wrap the real handler\n var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;\n\n // Copy event handlers in case event handlers array is modified during execution.\n if (eventFnsLength > 1) {\n eventFns = shallowCopy(eventFns);\n }\n for (var i = 0; i < eventFnsLength; i++) {\n if (!event.isImmediatePropagationStopped()) {\n handlerWrapper(element, event, eventFns[i]);\n }\n }\n };\n\n // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n // events on `element`\n eventHandler.elem = element;\n return eventHandler;\n }\n function defaultHandlerWrapper(element, event, handler) {\n handler.call(element, event);\n }\n function specialMouseHandlerWrapper(target, event, handler) {\n // Refer to jQuery's implementation of mouseenter & mouseleave\n // Read about mouseenter and mouseleave:\n // http://www.quirksmode.org/js/events_mouse.html#link8\n var related = event.relatedTarget;\n // For mousenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || related !== target && !jqLiteContains.call(target, related)) {\n handler.call(target, event);\n }\n }\n\n //////////////////////////////////////////\n // Functions iterating traversal.\n // These functions chain results into a single\n // selector.\n //////////////////////////////////////////\n forEach({\n removeData: jqLiteRemoveData,\n on: function jqLiteOn(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n // Do not add event handlers to non-elements because they will not be cleaned up.\n if (!jqLiteAcceptsData(element)) {\n return;\n }\n var expandoStore = jqLiteExpandoStore(element, true);\n var events = expandoStore.events;\n var handle = expandoStore.handle;\n if (!handle) {\n handle = expandoStore.handle = createEventHandler(element, events);\n }\n\n // http://jsperf.com/string-indexof-vs-split\n var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n var i = types.length;\n var addHandler = function (type, specialHandlerWrapper, noEventListener) {\n var eventFns = events[type];\n if (!eventFns) {\n eventFns = events[type] = [];\n eventFns.specialHandlerWrapper = specialHandlerWrapper;\n if (type !== '$destroy' && !noEventListener) {\n element.addEventListener(type, handle);\n }\n }\n eventFns.push(fn);\n };\n while (i--) {\n type = types[i];\n if (MOUSE_EVENT_MAP[type]) {\n addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);\n addHandler(type, undefined, true);\n } else {\n addHandler(type);\n }\n }\n },\n off: jqLiteOff,\n one: function (element, type, fn) {\n element = jqLite(element);\n\n //add the listener twice so that when it is called\n //you can remove the original function and still be\n //able to call element.off(ev, fn) normally\n element.on(type, function onFn() {\n element.off(type, fn);\n element.off(type, onFn);\n });\n element.on(type, fn);\n },\n replaceWith: function (element, replaceNode) {\n var index,\n parent = element.parentNode;\n jqLiteDealoc(element);\n forEach(new JQLite(replaceNode), function (node) {\n if (index) {\n parent.insertBefore(node, index.nextSibling);\n } else {\n parent.replaceChild(node, element);\n }\n index = node;\n });\n },\n children: function (element) {\n var children = [];\n forEach(element.childNodes, function (element) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n children.push(element);\n }\n });\n return children;\n },\n contents: function (element) {\n return element.contentDocument || element.childNodes || [];\n },\n append: function (element, node) {\n var nodeType = element.nodeType;\n if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n node = new JQLite(node);\n for (var i = 0, ii = node.length; i < ii; i++) {\n var child = node[i];\n element.appendChild(child);\n }\n },\n prepend: function (element, node) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n var index = element.firstChild;\n forEach(new JQLite(node), function (child) {\n element.insertBefore(child, index);\n });\n }\n },\n wrap: function (element, wrapNode) {\n jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);\n },\n remove: jqLiteRemove,\n detach: function (element) {\n jqLiteRemove(element, true);\n },\n after: function (element, newElement) {\n var index = element,\n parent = element.parentNode;\n if (parent) {\n newElement = new JQLite(newElement);\n for (var i = 0, ii = newElement.length; i < ii; i++) {\n var node = newElement[i];\n parent.insertBefore(node, index.nextSibling);\n index = node;\n }\n }\n },\n addClass: jqLiteAddClass,\n removeClass: jqLiteRemoveClass,\n toggleClass: function (element, selector, condition) {\n if (selector) {\n forEach(selector.split(' '), function (className) {\n var classCondition = condition;\n if (isUndefined(classCondition)) {\n classCondition = !jqLiteHasClass(element, className);\n }\n (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n });\n }\n },\n parent: function (element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n },\n next: function (element) {\n return element.nextElementSibling;\n },\n find: function (element, selector) {\n if (element.getElementsByTagName) {\n return element.getElementsByTagName(selector);\n } else {\n return [];\n }\n },\n clone: jqLiteClone,\n triggerHandler: function (element, event, extraParameters) {\n var dummyEvent, eventFnsCopy, handlerArgs;\n var eventName = event.type || event;\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var eventFns = events && events[eventName];\n if (eventFns) {\n // Create a dummy event to pass to the handlers\n dummyEvent = {\n preventDefault: function () {\n this.defaultPrevented = true;\n },\n isDefaultPrevented: function () {\n return this.defaultPrevented === true;\n },\n stopImmediatePropagation: function () {\n this.immediatePropagationStopped = true;\n },\n isImmediatePropagationStopped: function () {\n return this.immediatePropagationStopped === true;\n },\n stopPropagation: noop,\n type: eventName,\n target: element\n };\n\n // If a custom event was provided then extend our dummy event with it\n if (event.type) {\n dummyEvent = extend(dummyEvent, event);\n }\n\n // Copy event handlers in case event handlers array is modified during execution.\n eventFnsCopy = shallowCopy(eventFns);\n handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n forEach(eventFnsCopy, function (fn) {\n if (!dummyEvent.isImmediatePropagationStopped()) {\n fn.apply(element, handlerArgs);\n }\n });\n }\n }\n }, function (fn, name) {\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function (arg1, arg2, arg3) {\n var value;\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (isUndefined(value)) {\n value = fn(this[i], arg1, arg2, arg3);\n if (isDefined(value)) {\n // any function which returns a value needs to be wrapped\n value = jqLite(value);\n }\n } else {\n jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n }\n }\n return isDefined(value) ? value : this;\n };\n });\n\n // bind legacy bind/unbind to on/off\n JQLite.prototype.bind = JQLite.prototype.on;\n JQLite.prototype.unbind = JQLite.prototype.off;\n\n // Provider for private $$jqLite service\n /** @this */\n function $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function (node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n }\n\n /**\n * Computes a hash of an 'obj'.\n * Hash of a:\n * string is string\n * number is number as string\n * object is either result of calling $$hashKey function on the object or uniquely generated id,\n * that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n * The resulting string key is in 'type:hashKey' format.\n */\n function hashKey(obj, nextUidFn) {\n var key = obj && obj.$$hashKey;\n if (key) {\n if (typeof key === 'function') {\n key = obj.$$hashKey();\n }\n return key;\n }\n var objType = typeof obj;\n if (objType === 'function' || objType === 'object' && obj !== null) {\n key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n } else {\n key = objType + ':' + obj;\n }\n return key;\n }\n\n // A minimal ES2015 Map implementation.\n // Should be bug/feature equivalent to the native implementations of supported browsers\n // (for the features required in Angular).\n // See https://kangax.github.io/compat-table/es6/#test-Map\n var nanKey = Object.create(null);\n function NgMapShim() {\n this._keys = [];\n this._values = [];\n this._lastKey = NaN;\n this._lastIndex = -1;\n }\n NgMapShim.prototype = {\n _idx: function (key) {\n if (key !== this._lastKey) {\n this._lastKey = key;\n this._lastIndex = this._keys.indexOf(key);\n }\n return this._lastIndex;\n },\n _transformKey: function (key) {\n return isNumberNaN(key) ? nanKey : key;\n },\n get: function (key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx !== -1) {\n return this._values[idx];\n }\n },\n has: function (key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n return idx !== -1;\n },\n set: function (key, value) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n idx = this._lastIndex = this._keys.length;\n }\n this._keys[idx] = key;\n this._values[idx] = value;\n\n // Support: IE11\n // Do not `return this` to simulate the partial IE11 implementation\n },\n delete: function (key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n return false;\n }\n this._keys.splice(idx, 1);\n this._values.splice(idx, 1);\n this._lastKey = NaN;\n this._lastIndex = -1;\n return true;\n }\n };\n\n // For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations\n // are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map`\n // implementations get more stable, we can reconsider switching to `window.Map` (when available).\n var NgMap = NgMapShim;\n var $$MapProvider = [/** @this */function () {\n this.$get = [function () {\n return NgMap;\n }];\n }];\n\n /**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.} modules A list of module functions or their aliases. See\n * {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n * disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n * // create an injector\n * var $injector = angular.injector(['ng']);\n *\n * // use the injector to kick off your application\n * // use the type inference to auto inject arguments, or use implicit injection\n * $injector.invoke(function($rootScope, $compile, $document) {\n * $compile($document)($rootScope);\n * $rootScope.$digest();\n * });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running AngularJS app\n * from outside AngularJS. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('
{{content.label}}
');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n * var scope = angular.element($div).scope();\n * $compile($div)(scope);\n * });\n * ```\n */\n\n /**\n * @ngdoc module\n * @name auto\n * @installation\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\n var ARROW_ARG = /^([^(]+?)=>/;\n var FN_ARGS = /^[^(]*\\(\\s*([^)]*)\\)/m;\n var FN_ARG_SPLIT = /,/;\n var FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\n var STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\n var $injectorMinErr = minErr('$injector');\n function stringifyFn(fn) {\n return Function.prototype.toString.call(fn);\n }\n function extractArgs(fn) {\n var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''),\n args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);\n return args;\n }\n function anonFn(fn) {\n // For anonymous functions, showing at the very least the function signature can help in\n // debugging.\n var args = extractArgs(fn);\n if (args) {\n return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n }\n return 'fn';\n }\n function annotate(fn, strictDi, name) {\n var $inject, argDecl, last;\n if (typeof fn === 'function') {\n if (!($inject = fn.$inject)) {\n $inject = [];\n if (fn.length) {\n if (strictDi) {\n if (!isString(name) || !name) {\n name = fn.name || anonFn(fn);\n }\n throw $injectorMinErr('strictdi', '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n }\n argDecl = extractArgs(fn);\n forEach(argDecl[1].split(FN_ARG_SPLIT), function (arg) {\n arg.replace(FN_ARG, function (all, underscore, name) {\n $inject.push(name);\n });\n });\n }\n fn.$inject = $inject;\n }\n } else if (isArray(fn)) {\n last = fn.length - 1;\n assertArgFn(fn[last], 'fn');\n $inject = fn.slice(0, last);\n } else {\n assertArgFn(fn, 'fn', true);\n }\n return $inject;\n }\n\n ///////////////////////////////////////\n\n /**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n * var $injector = angular.injector();\n * expect($injector.get('$injector')).toBe($injector);\n * expect($injector.invoke(function($injector) {\n * return $injector;\n * })).toBe($injector);\n * ```\n *\n * ## Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n * // inferred (only works if code not minified/obfuscated)\n * $injector.invoke(function(serviceA){});\n *\n * // annotated\n * function explicit(serviceA) {};\n * explicit.$inject = ['serviceA'];\n * $injector.invoke(explicit);\n *\n * // inline\n * $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ### Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ### `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ### Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n /**\n * @ngdoc property\n * @name $injector#modules\n * @type {Object}\n * @description\n * A hash containing all the modules that have been loaded into the\n * $injector.\n *\n * You can use this property to find out information about a module via the\n * {@link angular.Module#info `myModule.info(...)`} method.\n *\n * For example:\n *\n * ```\n * var info = $injector.modules['ngAnimate'].info();\n * ```\n *\n * **Do not use this property to attempt to modify the modules after the application\n * has been bootstrapped.**\n */\n\n /**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string=} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n /**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {Function|Array.} fn The injectable function to invoke. Function parameters are\n * injected according to the {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n /**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n /**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n /**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * #### Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * #### The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n * // Given\n * var MyController = function(obfuscatedScope, obfuscatedRoute) {\n * // ...\n * }\n * // Define function dependencies\n * MyController['$inject'] = ['$scope', '$route'];\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * #### The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n * // We wish to write this (not minification / obfuscation safe)\n * injector.invoke(function($compile, $rootScope) {\n * // ...\n * });\n *\n * // We are forced to write break inlining\n * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n * // ...\n * };\n * tmpFn.$inject = ['$compile', '$rootScope'];\n * injector.invoke(tmpFn);\n *\n * // To better support inline function the inline annotation is supported\n * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n * // ...\n * }]);\n *\n * // Therefore\n * expect(injector.annotate(\n * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n * ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.} The names of the services which the function requires.\n */\n /**\n * @ngdoc method\n * @name $injector#loadNewModules\n *\n * @description\n *\n * **This is a dangerous API, which you use at your own risk!**\n *\n * Add the specified modules to the current injector.\n *\n * This method will add each of the injectables to the injector and execute all of the config and run\n * blocks for each module passed to the method.\n *\n * If a module has already been loaded into the injector then it will not be loaded again.\n *\n * * The application developer is responsible for loading the code containing the modules; and for\n * ensuring that lazy scripts are not downloaded and executed more often that desired.\n * * Previously compiled HTML will not be affected by newly loaded directives, filters and components.\n * * Modules cannot be unloaded.\n *\n * You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded\n * into the injector, which may indicate whether the script has been executed already.\n *\n * @example\n * Here is an example of loading a bundle of modules, with a utility method called `getScript`:\n *\n * ```javascript\n * app.factory('loadModule', function($injector) {\n * return function loadModule(moduleName, bundleUrl) {\n * return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); });\n * };\n * })\n * ```\n *\n * @param {Array=} mods an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n */\n\n /**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An AngularJS **service** is a singleton object created by a **service factory**. These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider. The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the\n * {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function**\n * that will be wrapped in a **service provider** object, whose `$get` property will contain the\n * given factory function.\n * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function**\n * that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n * a new object using the given constructor function.\n * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that\n * will be able to modify or replace the implementation of another service.\n *\n * See the individual methods for more information and examples.\n */\n\n /**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * It is possible to inject other providers into the provider function,\n * but the injected provider must have been defined before the one that requires it.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n 'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n \n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n * // Define the eventTracker provider\n * function EventTrackerProvider() {\n * var trackingUrl = '/track';\n *\n * // A provider method for configuring where the tracked events should been saved\n * this.setTrackingUrl = function(url) {\n * trackingUrl = url;\n * };\n *\n * // The service factory function\n * this.$get = ['$http', function($http) {\n * var trackedEvents = {};\n * return {\n * // Call this to track an event\n * event: function(event) {\n * var count = trackedEvents[event] || 0;\n * count += 1;\n * trackedEvents[event] = count;\n * return count;\n * },\n * // Call this to save the tracked events to the trackingUrl\n * save: function() {\n * $http.post(trackingUrl, trackedEvents);\n * }\n * };\n * }];\n * }\n *\n * describe('eventTracker', function() {\n * var postSpy;\n *\n * beforeEach(module(function($provide) {\n * // Register the eventTracker provider\n * $provide.provider('eventTracker', EventTrackerProvider);\n * }));\n *\n * beforeEach(module(function(eventTrackerProvider) {\n * // Configure eventTracker provider\n * eventTrackerProvider.setTrackingUrl('/custom-track');\n * }));\n *\n * it('tracks events', inject(function(eventTracker) {\n * expect(eventTracker.event('login')).toEqual(1);\n * expect(eventTracker.event('login')).toEqual(2);\n * }));\n *\n * it('saves to the tracking url', inject(function(eventTracker, $http) {\n * postSpy = spyOn($http, 'post');\n * eventTracker.event('login');\n * eventTracker.save();\n * expect(postSpy).toHaveBeenCalled();\n * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n * }));\n * });\n * ```\n */\n\n /**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} $getFn The injectable $getFn for the instance creation.\n * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * ```\n */\n\n /**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is a factory\n * function that returns an instance instantiated by the injector from the service constructor\n * function.\n *\n * Internally it looks a bit like this:\n *\n * ```\n * {\n * $get: function() {\n * return $injector.instantiate(constructor);\n * }\n * }\n * ```\n *\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} constructor An injectable class (constructor function)\n * that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n * var Ping = function($http) {\n * this.$http = $http;\n * };\n *\n * Ping.$inject = ['$http'];\n *\n * Ping.prototype.send = function() {\n * return this.$http.get('/ping');\n * };\n * $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping.send();\n * }]);\n * ```\n */\n\n /**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function. This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**. That also means it is not possible to inject other services into a value service.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an AngularJS {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n * $provide.value('ADMIN_USER', 'admin');\n *\n * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n * $provide.value('halfOf', function(value) {\n * return value / 2;\n * });\n * ```\n */\n\n /**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service** with the {@link auto.$injector $injector}, such as a string,\n * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not\n * possible to inject other services into a constant.\n *\n * But unlike {@link auto.$provide#value value}, a constant can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an AngularJS {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n * $provide.constant('SHARD_HEIGHT', 306);\n *\n * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n * $provide.constant('double', function(value) {\n * return value * 2;\n * });\n * ```\n */\n\n /**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function\n * intercepts the creation of a service, allowing it to override or modify the behavior of the\n * service. The return value of the decorator function may be the original service, or a new service\n * that replaces (or wraps and delegates to) the original service.\n *\n * You can find out more about using decorators in the {@link guide/decorators} guide.\n *\n * @param {string} name The name of the service to decorate.\n * @param {Function|Array.} decorator This function will be invoked when the service needs to be\n * provided and should return the decorated service instance. The function is called using\n * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n * Local injection arguments:\n *\n * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured,\n * decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n * $provide.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * ```\n */\n\n function createInjector(modulesToLoad, strictDi) {\n strictDi = strictDi === true;\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new NgMap(),\n providerCache = {\n $provide: {\n provider: supportObject(provider),\n factory: supportObject(factory),\n service: supportObject(service),\n value: supportObject(value),\n constant: supportObject(constant),\n decorator: decorator\n }\n },\n providerInjector = providerCache.$injector = createInternalInjector(providerCache, function (serviceName, caller) {\n if (angular.isString(caller)) {\n path.push(caller);\n }\n throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- '));\n }),\n instanceCache = {},\n protoInstanceInjector = createInternalInjector(instanceCache, function (serviceName, caller) {\n var provider = providerInjector.get(serviceName + providerSuffix, caller);\n return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);\n }),\n instanceInjector = protoInstanceInjector;\n providerCache['$injector' + providerSuffix] = {\n $get: valueFn(protoInstanceInjector)\n };\n instanceInjector.modules = providerInjector.modules = createMap();\n var runBlocks = loadModules(modulesToLoad);\n instanceInjector = protoInstanceInjector.get('$injector');\n instanceInjector.strictDi = strictDi;\n forEach(runBlocks, function (fn) {\n if (fn) instanceInjector.invoke(fn);\n });\n instanceInjector.loadNewModules = function (mods) {\n forEach(loadModules(mods), function (fn) {\n if (fn) instanceInjector.invoke(fn);\n });\n };\n return instanceInjector;\n\n ////////////////////////////////////\n // $provider\n ////////////////////////////////////\n\n function supportObject(delegate) {\n return function (key, value) {\n if (isObject(key)) {\n forEach(key, reverseParams(delegate));\n } else {\n return delegate(key, value);\n }\n };\n }\n function provider(name, provider_) {\n assertNotHasOwnProperty(name, 'service');\n if (isFunction(provider_) || isArray(provider_)) {\n provider_ = providerInjector.instantiate(provider_);\n }\n if (!provider_.$get) {\n throw $injectorMinErr('pget', 'Provider \\'{0}\\' must define $get factory method.', name);\n }\n return providerCache[name + providerSuffix] = provider_;\n }\n function enforceReturnValue(name, factory) {\n return /** @this */function enforcedReturnValue() {\n var result = instanceInjector.invoke(factory, this);\n if (isUndefined(result)) {\n throw $injectorMinErr('undef', 'Provider \\'{0}\\' must return a value from $get factory method.', name);\n }\n return result;\n };\n }\n function factory(name, factoryFn, enforce) {\n return provider(name, {\n $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n });\n }\n function service(name, constructor) {\n return factory(name, ['$injector', function ($injector) {\n return $injector.instantiate(constructor);\n }]);\n }\n function value(name, val) {\n return factory(name, valueFn(val), false);\n }\n function constant(name, value) {\n assertNotHasOwnProperty(name, 'constant');\n providerCache[name] = value;\n instanceCache[name] = value;\n }\n function decorator(serviceName, decorFn) {\n var origProvider = providerInjector.get(serviceName + providerSuffix),\n orig$get = origProvider.$get;\n origProvider.$get = function () {\n var origInstance = instanceInjector.invoke(orig$get, origProvider);\n return instanceInjector.invoke(decorFn, null, {\n $delegate: origInstance\n });\n };\n }\n\n ////////////////////////////////////\n // Module Loading\n ////////////////////////////////////\n function loadModules(modulesToLoad) {\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');\n var runBlocks = [],\n moduleFn;\n forEach(modulesToLoad, function (module) {\n if (loadedModules.get(module)) return;\n loadedModules.set(module, true);\n function runInvokeQueue(queue) {\n var i, ii;\n for (i = 0, ii = queue.length; i < ii; i++) {\n var invokeArgs = queue[i],\n provider = providerInjector.get(invokeArgs[0]);\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\n }\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n instanceInjector.modules[module] = moduleFn;\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n runInvokeQueue(moduleFn._invokeQueue);\n runInvokeQueue(moduleFn._configBlocks);\n } else if (isFunction(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else if (isArray(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else {\n assertArgFn(module, 'module');\n }\n } catch (e) {\n if (isArray(module)) {\n module = module[module.length - 1];\n }\n if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {\n // Safari & FF's stack traces don't contain error.message content\n // unlike those of Chrome and IE\n // So if stack doesn't contain message, we create a new string that contains both.\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n // eslint-disable-next-line no-ex-assign\n e = e.message + '\\n' + e.stack;\n }\n throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\\n{1}', module, e.stack || e.message || e);\n }\n });\n return runBlocks;\n }\n\n ////////////////////////////////////\n // internal Injector\n ////////////////////////////////////\n\n function createInternalInjector(cache, factory) {\n function getService(serviceName, caller) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}', serviceName + ' <- ' + path.join(' <- '));\n }\n return cache[serviceName];\n } else {\n try {\n path.unshift(serviceName);\n cache[serviceName] = INSTANTIATING;\n cache[serviceName] = factory(serviceName, caller);\n return cache[serviceName];\n } catch (err) {\n if (cache[serviceName] === INSTANTIATING) {\n delete cache[serviceName];\n }\n throw err;\n } finally {\n path.shift();\n }\n }\n }\n function injectionArgs(fn, locals, serviceName) {\n var args = [],\n $inject = createInjector.$$annotate(fn, strictDi, serviceName);\n for (var i = 0, length = $inject.length; i < length; i++) {\n var key = $inject[i];\n if (typeof key !== 'string') {\n throw $injectorMinErr('itkn', 'Incorrect injection token! Expected service name as string, got {0}', key);\n }\n args.push(locals && locals.hasOwnProperty(key) ? locals[key] : getService(key, serviceName));\n }\n return args;\n }\n function isClass(func) {\n // Support: IE 9-11 only\n // IE 9-11 do not support classes and IE9 leaks with the code below.\n if (msie || typeof func !== 'function') {\n return false;\n }\n var result = func.$$ngIsClass;\n if (!isBoolean(result)) {\n result = func.$$ngIsClass = /^class\\b/.test(stringifyFn(func));\n }\n return result;\n }\n function invoke(fn, self, locals, serviceName) {\n if (typeof locals === 'string') {\n serviceName = locals;\n locals = null;\n }\n var args = injectionArgs(fn, locals, serviceName);\n if (isArray(fn)) {\n fn = fn[fn.length - 1];\n }\n if (!isClass(fn)) {\n // http://jsperf.com/angularjs-invoke-apply-vs-switch\n // #5388\n return fn.apply(self, args);\n } else {\n args.unshift(null);\n return new (Function.prototype.bind.apply(fn, args))();\n }\n }\n function instantiate(Type, locals, serviceName) {\n // Check if Type is annotated and use just the given function at n-1 as parameter\n // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n var ctor = isArray(Type) ? Type[Type.length - 1] : Type;\n var args = injectionArgs(Type, locals, serviceName);\n // Empty object at position 0 is ignored for invocation with `new`, but required.\n args.unshift(null);\n return new (Function.prototype.bind.apply(ctor, args))();\n }\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: createInjector.$$annotate,\n has: function (name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n }\n createInjector.$$annotate = annotate;\n\n /**\n * @ngdoc provider\n * @name $anchorScrollProvider\n * @this\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\n function $AnchorScrollProvider() {\n var autoScrollingEnabled = true;\n\n /**\n * @ngdoc method\n * @name $anchorScrollProvider#disableAutoScrolling\n *\n * @description\n * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
\n * Use this method to disable automatic scrolling.\n *\n * If automatic scrolling is disabled, one must explicitly call\n * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n * current hash.\n */\n this.disableAutoScrolling = function () {\n autoScrollingEnabled = false;\n };\n\n /**\n * @ngdoc service\n * @name $anchorScroll\n * @kind function\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the\n * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified\n * in the\n * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document).\n *\n * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n * match any anchor whenever it changes. This can be disabled by calling\n * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n *\n * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n * vertical scroll-offset (either fixed or dynamic).\n *\n * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of\n * {@link ng.$location#hash $location.hash()} will be used.\n *\n * @property {(number|function|jqLite)} yOffset\n * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n * positioned elements at the top of the page, such as navbars, headers etc.\n *\n * `yOffset` can be specified in various ways:\n * - **number**: A fixed number of pixels to be used as offset.

\n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).

\n * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n * the top of the page to the element's bottom will be used as offset.
\n * **Note**: The element will be taken into account only as long as its `position` is set to\n * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n * their height and/or positioning according to the viewport's size.\n *\n *
\n *
\n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n *
\n *\n * @example\n \n \n
\n Go to bottom\n You're at the bottom!\n
\n
\n \n angular.module('anchorScrollExample', [])\n .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n function($scope, $location, $anchorScroll) {\n $scope.gotoBottom = function() {\n // set the location.hash to the id of\n // the element you wish to scroll to.\n $location.hash('bottom');\n // call $anchorScroll()\n $anchorScroll();\n };\n }]);\n \n \n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n \n
\n *\n *
\n * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n *\n * @example\n \n \n \n
\n Anchor {{x}} of 5\n
\n
\n \n angular.module('anchorScrollOffsetExample', [])\n .run(['$anchorScroll', function($anchorScroll) {\n $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels\n }])\n .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n function($anchorScroll, $location, $scope) {\n $scope.gotoAnchor = function(x) {\n var newHash = 'anchor' + x;\n if ($location.hash() !== newHash) {\n // set the $location.hash to `newHash` and\n // $anchorScroll will automatically scroll to it\n $location.hash('anchor' + x);\n } else {\n // call $anchorScroll() explicitly,\n // since $location.hash hasn't changed\n $anchorScroll();\n }\n };\n }\n ]);\n \n \n body {\n padding-top: 50px;\n }\n .anchor {\n border: 2px dashed DarkOrchid;\n padding: 10px 10px 200px 10px;\n }\n .fixed-header {\n background-color: rgba(0, 0, 0, 0.2);\n height: 50px;\n position: fixed;\n top: 0; left: 0; right: 0;\n }\n .fixed-header > a {\n display: inline-block;\n margin: 5px 15px;\n }\n \n
\n */\n this.$get = ['$window', '$location', '$rootScope', function ($window, $location, $rootScope) {\n var document = $window.document;\n\n // Helper function to get first anchor from a NodeList\n // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n // and working in all supported browsers.)\n function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function (element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }\n function getYOffset() {\n var offset = scroll.yOffset;\n if (isFunction(offset)) {\n offset = offset();\n } else if (isElement(offset)) {\n var elem = offset[0];\n var style = $window.getComputedStyle(elem);\n if (style.position !== 'fixed') {\n offset = 0;\n } else {\n offset = elem.getBoundingClientRect().bottom;\n }\n } else if (!isNumber(offset)) {\n offset = 0;\n }\n return offset;\n }\n function scrollTo(elem) {\n if (elem) {\n elem.scrollIntoView();\n var offset = getYOffset();\n if (offset) {\n // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n // top of the viewport.\n //\n // IF the number of pixels from the top of `elem` to the end of the page's content is less\n // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n // way down the page.\n //\n // This is often the case for elements near the bottom of the page.\n //\n // In such cases we do not need to scroll the whole `offset` up, just the difference between\n // the top of the element and the offset, which is enough to align the top of `elem` at the\n // desired position.\n var elemTop = elem.getBoundingClientRect().top;\n $window.scrollBy(0, elemTop - offset);\n }\n } else {\n $window.scrollTo(0, 0);\n }\n }\n function scroll(hash) {\n // Allow numeric hashes\n hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash();\n var elm;\n\n // empty hash, scroll to the top of the page\n if (!hash) scrollTo(null);\n\n // element with given id\n else if (elm = document.getElementById(hash)) scrollTo(elm);\n\n // first anchor with given name :-D\n else if (elm = getFirstAnchor(document.getElementsByName(hash))) scrollTo(elm);\n\n // no element and hash === 'top', scroll to the top of the page\n else if (hash === 'top') scrollTo(null);\n }\n\n // does not scroll when user clicks on anchor link that is currently on\n // (no url change, no $location.hash() change), browser native does scroll\n if (autoScrollingEnabled) {\n $rootScope.$watch(function autoScrollWatch() {\n return $location.hash();\n }, function autoScrollWatchAction(newVal, oldVal) {\n // skip the initial scroll if $location.hash is empty\n if (newVal === oldVal && newVal === '') return;\n jqLiteDocumentLoaded(function () {\n $rootScope.$evalAsync(scroll);\n });\n });\n }\n return scroll;\n }];\n }\n var $animateMinErr = minErr('$animate');\n var ELEMENT_NODE = 1;\n var NG_ANIMATE_CLASSNAME = 'ng-animate';\n function mergeClasses(a, b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n }\n function extractElementNode(element) {\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n }\n function splitClasses(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n // Use createMap() to prevent class assumptions involving property names in\n // Object.prototype\n var obj = createMap();\n forEach(classes, function (klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n // if any other type of options value besides an Object value is\n // passed into the $animate.method() animation then this helper code\n // will be run which will ignore it. While this patch is not the\n // greatest solution to this, a lot of existing plugins depend on\n // $animate to either call the callback (< 1.2) or return a promise\n // that can be changed. This helper function ensures that the options\n // are wiped clean incase a callback function is provided.\n function prepareAnimateOptions(options) {\n return isObject(options) ? options : {};\n }\n var $$CoreAnimateJsProvider = /** @this */function () {\n this.$get = noop;\n };\n\n // this is prefixed with Core since it conflicts with\n // the animateQueueProvider defined in ngAnimate/animateQueue.js\n var $$CoreAnimateQueueProvider = /** @this */function () {\n var postDigestQueue = new NgMap();\n var postDigestElements = [];\n this.$get = ['$$AnimateRunner', '$rootScope', function ($$AnimateRunner, $rootScope) {\n return {\n enabled: noop,\n on: noop,\n off: noop,\n pin: noop,\n push: function (element, event, options, domOperation) {\n if (domOperation) {\n domOperation();\n }\n options = options || {};\n if (options.from) {\n element.css(options.from);\n }\n if (options.to) {\n element.css(options.to);\n }\n if (options.addClass || options.removeClass) {\n addRemoveClassesPostDigest(element, options.addClass, options.removeClass);\n }\n var runner = new $$AnimateRunner();\n\n // since there are no animations to run the runner needs to be\n // notified that the animation call is complete.\n runner.complete();\n return runner;\n }\n };\n function updateData(data, classes, value) {\n var changed = false;\n if (classes) {\n classes = isString(classes) ? classes.split(' ') : isArray(classes) ? classes : [];\n forEach(classes, function (className) {\n if (className) {\n changed = true;\n data[className] = value;\n }\n });\n }\n return changed;\n }\n function handleCSSClassChanges() {\n forEach(postDigestElements, function (element) {\n var data = postDigestQueue.get(element);\n if (data) {\n var existing = splitClasses(element.attr('class'));\n var toAdd = '';\n var toRemove = '';\n forEach(data, function (status, className) {\n var hasClass = !!existing[className];\n if (status !== hasClass) {\n if (status) {\n toAdd += (toAdd.length ? ' ' : '') + className;\n } else {\n toRemove += (toRemove.length ? ' ' : '') + className;\n }\n }\n });\n forEach(element, function (elm) {\n if (toAdd) {\n jqLiteAddClass(elm, toAdd);\n }\n if (toRemove) {\n jqLiteRemoveClass(elm, toRemove);\n }\n });\n postDigestQueue.delete(element);\n }\n });\n postDigestElements.length = 0;\n }\n function addRemoveClassesPostDigest(element, add, remove) {\n var data = postDigestQueue.get(element) || {};\n var classesAdded = updateData(data, add, true);\n var classesRemoved = updateData(data, remove, false);\n if (classesAdded || classesRemoved) {\n postDigestQueue.set(element, data);\n postDigestElements.push(element);\n if (postDigestElements.length === 1) {\n $rootScope.$$postDigest(handleCSSClassChanges);\n }\n }\n }\n }];\n };\n\n /**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM updates and resolves the returned runner promise.\n *\n * In order to enable animations the `ngAnimate` module has to be loaded.\n *\n * To see the functional implementation check out `src/ngAnimate/animate.js`.\n */\n var $AnimateProvider = ['$provide', /** @this */function ($provide) {\n var provider = this;\n var classNameFilter = null;\n var customFilter = null;\n this.$$registeredAnimations = Object.create(null);\n\n /**\n * @ngdoc method\n * @name $animateProvider#register\n *\n * @description\n * Registers a new injectable animation factory function. The factory function produces the\n * animation object which contains callback functions for each event that is expected to be\n * animated.\n *\n * * `eventFn`: `function(element, ... , doneFunction, options)`\n * The element to animate, the `doneFunction` and the options fed into the animation. Depending\n * on the type of animation additional arguments will be injected into the animation function. The\n * list below explains the function signatures for the different animation methods:\n *\n * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)\n * - addClass: function(element, addedClasses, doneFunction, options)\n * - removeClass: function(element, removedClasses, doneFunction, options)\n * - enter, leave, move: function(element, doneFunction, options)\n * - animate: function(element, fromStyles, toStyles, doneFunction, options)\n *\n * Make sure to trigger the `doneFunction` once the animation is fully complete.\n *\n * ```js\n * return {\n * //enter, leave, move signature\n * eventFn : function(element, done, options) {\n * //code to run the animation\n * //once complete, then run done()\n * return function endFunction(wasCancelled) {\n * //code to cancel the animation\n * }\n * }\n * }\n * ```\n *\n * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).\n * @param {Function} factory The factory function that will be executed to return the animation\n * object.\n */\n this.register = function (name, factory) {\n if (name && name.charAt(0) !== '.') {\n throw $animateMinErr('notcsel', 'Expecting class selector starting with \\'.\\' got \\'{0}\\'.', name);\n }\n var key = name + '-animation';\n provider.$$registeredAnimations[name.substr(1)] = key;\n $provide.factory(key, factory);\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#customFilter\n *\n * @description\n * Sets and/or returns the custom filter function that is used to \"filter\" animations, i.e.\n * determine if an animation is allowed or not. When no filter is specified (the default), no\n * animation will be blocked. Setting the `customFilter` value will only allow animations for\n * which the filter function's return value is truthy.\n *\n * This allows to easily create arbitrarily complex rules for filtering animations, such as\n * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc.\n * Filtering animations can also boost performance for low-powered devices, as well as\n * applications containing a lot of structural operations.\n *\n *
\n * **Best Practice:**\n * Keep the filtering function as lean as possible, because it will be called for each DOM\n * action (e.g. insertion, removal, class change) performed by \"animation-aware\" directives.\n * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in\n * directives that support animations.\n * Performing computationally expensive or time-consuming operations on each call of the\n * filtering function can make your animations sluggish.\n *
\n *\n * **Note:** If present, `customFilter` will be checked before\n * {@link $animateProvider#classNameFilter classNameFilter}.\n *\n * @param {Function=} filterFn - The filter function which will be used to filter all animations.\n * If a falsy value is returned, no animation will be performed. The function will be called\n * with the following arguments:\n * - **node** `{DOMElement}` - The DOM element to be animated.\n * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`\n * etc).\n * - **options** `{Object}` - A collection of options/styles used for the animation.\n * @return {Function} The current filter function or `null` if there is none set.\n */\n this.customFilter = function (filterFn) {\n if (arguments.length === 1) {\n customFilter = isFunction(filterFn) ? filterFn : null;\n }\n return customFilter;\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#classNameFilter\n *\n * @description\n * Sets and/or returns the CSS class regular expression that is checked when performing\n * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n * therefore enable $animate to attempt to perform an animation on any element that is triggered.\n * When setting the `classNameFilter` value, animations will only be performed on elements\n * that successfully match the filter expression. This in turn can boost performance\n * for low-powered devices as well as applications containing a lot of structural operations.\n *\n * **Note:** If present, `classNameFilter` will be checked after\n * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns\n * false, `classNameFilter` will not be checked.\n *\n * @param {RegExp=} expression The className expression which will be checked against all animations\n * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n */\n this.classNameFilter = function (expression) {\n if (arguments.length === 1) {\n classNameFilter = expression instanceof RegExp ? expression : null;\n if (classNameFilter) {\n var reservedRegex = new RegExp('[(\\\\s|\\\\/)]' + NG_ANIMATE_CLASSNAME + '[(\\\\s|\\\\/)]');\n if (reservedRegex.test(classNameFilter.toString())) {\n classNameFilter = null;\n throw $animateMinErr('nongcls', '$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the \"{0}\" CSS class.', NG_ANIMATE_CLASSNAME);\n }\n }\n }\n return classNameFilter;\n };\n this.$get = ['$$animateQueue', function ($$animateQueue) {\n function domInsert(element, parentElement, afterElement) {\n // if for some reason the previous element was removed\n // from the dom sometime before this code runs then let's\n // just stick to using the parent element as the anchor\n if (afterElement) {\n var afterNode = extractElementNode(afterElement);\n if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {\n afterElement = null;\n }\n }\n if (afterElement) {\n afterElement.after(element);\n } else {\n parentElement.prepend(element);\n }\n }\n\n /**\n * @ngdoc service\n * @name $animate\n * @description The $animate service exposes a series of DOM utility methods that provide support\n * for animation hooks. The default behavior is the application of DOM operations, however,\n * when an animation is detected (and animations are enabled), $animate will do the heavy lifting\n * to ensure that animation runs with the triggered DOM operation.\n *\n * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't\n * included and only when it is active then the animation hooks that `$animate` triggers will be\n * functional. Once active then all structural `ng-` directives will trigger animations as they perform\n * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,\n * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.\n *\n * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.\n *\n * To learn more about enabling animation support, click here to visit the\n * {@link ngAnimate ngAnimate module page}.\n */\n return {\n // we don't call it directly since non-existant arguments may\n // be interpreted as null within the sub enabled function\n\n /**\n *\n * @ngdoc method\n * @name $animate#on\n * @kind function\n * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)\n * has fired on the given element or among any of its children. Once the listener is fired, the provided callback\n * is fired with the following params:\n *\n * ```js\n * $animate.on('enter', container,\n * function callback(element, phase) {\n * // cool we detected an enter animation within the container\n * }\n * );\n * ```\n *\n *
\n * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,\n * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}\n * will fire `addClass` if classes are added, and `removeClass` if classes are removed.\n * However, there are two exceptions:\n *\n *
    \n *
  • if both an {@link ng.$animate#addClass addClass()} and a\n * {@link ng.$animate#removeClass removeClass()} action are performed during the same\n * animation, the event fired will be `setClass`. This is true even for `ngClass`.
  • \n *
  • an {@link ng.$animate#animate animate()} call that adds and removes classes will fire\n * the `setClass` event, but if it either removes or adds classes,\n * it will fire `animate` instead.
  • \n *
\n *\n *
\n *\n * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself\n * as well as among its children\n * @param {Function} callback the callback function that will be fired when the listener is triggered.\n *\n * The arguments present in the callback function are:\n * * `element` - The captured DOM element that the animation was fired on.\n * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).\n * * `data` - an object with these properties:\n * * addClass - `{string|null}` - space-separated CSS classes to add to the element\n * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element\n * * from - `{Object|null}` - CSS properties & values at the beginning of the animation\n * * to - `{Object|null}` - CSS properties & values at the end of the animation\n *\n * Note that the callback does not trigger a scope digest. Wrap your call into a\n * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.\n */\n on: $$animateQueue.on,\n /**\n *\n * @ngdoc method\n * @name $animate#off\n * @kind function\n * @description Deregisters an event listener based on the event which has been associated with the provided element. This method\n * can be used in three different ways depending on the arguments:\n *\n * ```js\n * // remove all the animation event listeners listening for `enter`\n * $animate.off('enter');\n *\n * // remove listeners for all animation events from the container element\n * $animate.off(container);\n *\n * // remove all the animation event listeners listening for `enter` on the given element and its children\n * $animate.off('enter', container);\n *\n * // remove the event listener function provided by `callback` that is set\n * // to listen for `enter` on the given `container` as well as its children\n * $animate.off('enter', container, callback);\n * ```\n *\n * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move,\n * addClass, removeClass, etc...), or the container element. If it is the element, all other\n * arguments are ignored.\n * @param {DOMElement=} container the container element the event listener was placed on\n * @param {Function=} callback the callback function that was registered as the listener\n */\n off: $$animateQueue.off,\n /**\n * @ngdoc method\n * @name $animate#pin\n * @kind function\n * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists\n * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the\n * element despite being outside the realm of the application or within another application. Say for example if the application\n * was bootstrapped on an element that is somewhere inside of the `` tag, but we wanted to allow for an element to be situated\n * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind\n * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.\n *\n * Note that this feature is only active when the `ngAnimate` module is used.\n *\n * @param {DOMElement} element the external element that will be pinned\n * @param {DOMElement} parentElement the host parent element that will be associated with the external element\n */\n pin: $$animateQueue.pin,\n /**\n *\n * @ngdoc method\n * @name $animate#enabled\n * @kind function\n * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This\n * function can be called in four ways:\n *\n * ```js\n * // returns true or false\n * $animate.enabled();\n *\n * // changes the enabled state for all animations\n * $animate.enabled(false);\n * $animate.enabled(true);\n *\n * // returns true or false if animations are enabled for an element\n * $animate.enabled(element);\n *\n * // changes the enabled state for an element and its children\n * $animate.enabled(element, true);\n * $animate.enabled(element, false);\n * ```\n *\n * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state\n * @param {boolean=} enabled whether or not the animations will be enabled for the element\n *\n * @return {boolean} whether or not animations are enabled\n */\n enabled: $$animateQueue.enabled,\n /**\n * @ngdoc method\n * @name $animate#cancel\n * @kind function\n * @description Cancels the provided animation and applies the end state of the animation.\n * Note that this does not cancel the underlying operation, e.g. the setting of classes or\n * adding the element to the DOM.\n *\n * @param {animationRunner} animationRunner An animation runner returned by an $animate function.\n *\n * @example\n \n \n angular.module('animationExample', ['ngAnimate']).component('cancelExample', {\n templateUrl: 'template.html',\n controller: function($element, $animate) {\n this.runner = null;\n this.addClass = function() {\n this.runner = $animate.addClass($element.find('div'), 'red');\n var ctrl = this;\n this.runner.finally(function() {\n ctrl.runner = null;\n });\n };\n this.removeClass = function() {\n this.runner = $animate.removeClass($element.find('div'), 'red');\n var ctrl = this;\n this.runner.finally(function() {\n ctrl.runner = null;\n });\n };\n this.cancel = function() {\n $animate.cancel(this.runner);\n };\n }\n });\n \n \n

\n \n \n
\n \n
\n

CSS-Animated Text
\n

\n
\n \n \n \n \n .red-add, .red-remove {\n transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);\n }\n .red,\n .red-add.red-add-active {\n color: #FF0000;\n font-size: 40px;\n }\n .red-remove.red-remove-active {\n font-size: 10px;\n color: black;\n }\n \n
\n */\n cancel: function (runner) {\n if (runner.cancel) {\n runner.cancel();\n }\n },\n /**\n *\n * @ngdoc method\n * @name $animate#enter\n * @kind function\n * @description Inserts the element into the DOM either after the `after` element (if provided) or\n * as the first child within the `parent` element and then triggers an animation.\n * A promise is returned that will be resolved during the next digest once the animation\n * has completed.\n *\n * @param {DOMElement} element the element which will be inserted into the DOM\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n enter: function (element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));\n },\n /**\n *\n * @ngdoc method\n * @name $animate#move\n * @kind function\n * @description Inserts (moves) the element into its new position in the DOM either after\n * the `after` element (if provided) or as the first child within the `parent` element\n * and then triggers an animation. A promise is returned that will be resolved\n * during the next digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be moved into the new DOM position\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n move: function (element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));\n },\n /**\n * @ngdoc method\n * @name $animate#leave\n * @kind function\n * @description Triggers an animation and then removes the element from the DOM.\n * When the function is called a promise is returned that will be resolved during the next\n * digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be removed from the DOM\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n leave: function (element, options) {\n return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function () {\n element.remove();\n });\n },\n /**\n * @ngdoc method\n * @name $animate#addClass\n * @kind function\n *\n * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon\n * execution, the addClass operation will only be handled after the next digest and it will not trigger an\n * animation if element already contains the CSS class or if the class is removed at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} animationRunner the animation runner\n */\n addClass: function (element, className, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addclass, className);\n return $$animateQueue.push(element, 'addClass', options);\n },\n /**\n * @ngdoc method\n * @name $animate#removeClass\n * @kind function\n *\n * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon\n * execution, the removeClass operation will only be handled after the next digest and it will not trigger an\n * animation if element does not contain the CSS class or if the class is added at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n removeClass: function (element, className, options) {\n options = prepareAnimateOptions(options);\n options.removeClass = mergeClasses(options.removeClass, className);\n return $$animateQueue.push(element, 'removeClass', options);\n },\n /**\n * @ngdoc method\n * @name $animate#setClass\n * @kind function\n *\n * @description Performs both the addition and removal of a CSS classes on an element and (during the process)\n * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and\n * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has\n * passed. Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n setClass: function (element, add, remove, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addClass, add);\n options.removeClass = mergeClasses(options.removeClass, remove);\n return $$animateQueue.push(element, 'setClass', options);\n },\n /**\n * @ngdoc method\n * @name $animate#animate\n * @kind function\n *\n * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.\n * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take\n * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and\n * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding\n * style in `to`, the style in `from` is applied immediately, and no animation is run.\n * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`\n * method (or as part of the `options` parameter):\n *\n * ```js\n * ngModule.animation('.my-inline-animation', function() {\n * return {\n * animate : function(element, from, to, done, options) {\n * //animation\n * done();\n * }\n * }\n * });\n * ```\n *\n * @param {DOMElement} element the element which the CSS styles will be applied to\n * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.\n * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.\n * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If\n * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.\n * (Note that if no animation is detected then this value will not be applied to the element.)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n animate: function (element, from, to, className, options) {\n options = prepareAnimateOptions(options);\n options.from = options.from ? extend(options.from, from) : from;\n options.to = options.to ? extend(options.to, to) : to;\n className = className || 'ng-inline-animate';\n options.tempClasses = mergeClasses(options.tempClasses, className);\n return $$animateQueue.push(element, 'animate', options);\n }\n };\n }];\n }];\n var $$AnimateAsyncRunFactoryProvider = /** @this */function () {\n this.$get = ['$$rAF', function ($$rAF) {\n var waitQueue = [];\n function waitForTick(fn) {\n waitQueue.push(fn);\n if (waitQueue.length > 1) return;\n $$rAF(function () {\n for (var i = 0; i < waitQueue.length; i++) {\n waitQueue[i]();\n }\n waitQueue = [];\n });\n }\n return function () {\n var passed = false;\n waitForTick(function () {\n passed = true;\n });\n return function (callback) {\n if (passed) {\n callback();\n } else {\n waitForTick(callback);\n }\n };\n };\n }];\n };\n var $$AnimateRunnerFactoryProvider = /** @this */function () {\n this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout', function ($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n AnimateRunner.chain = function (chain, callback) {\n var index = 0;\n next();\n function next() {\n if (index === chain.length) {\n callback(true);\n return;\n }\n chain[index](function (response) {\n if (response === false) {\n callback(false);\n return;\n }\n index++;\n next();\n });\n }\n };\n AnimateRunner.all = function (runners, callback) {\n var count = 0;\n var status = true;\n forEach(runners, function (runner) {\n runner.done(onProgress);\n });\n function onProgress(response) {\n status = status && response;\n if (++count === runners.length) {\n callback(status);\n }\n }\n };\n function AnimateRunner(host) {\n this.setHost(host);\n var rafTick = $$animateAsyncRun();\n var timeoutTick = function (fn) {\n $timeout(fn, 0, false);\n };\n this._doneCallbacks = [];\n this._tick = function (fn) {\n if ($$isDocumentHidden()) {\n timeoutTick(fn);\n } else {\n rafTick(fn);\n }\n };\n this._state = 0;\n }\n AnimateRunner.prototype = {\n setHost: function (host) {\n this.host = host || {};\n },\n done: function (fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n progress: noop,\n getPromise: function () {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function (resolve, reject) {\n self.done(function (status) {\n if (status === false) {\n reject();\n } else {\n resolve();\n }\n });\n });\n }\n return this.promise;\n },\n then: function (resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n 'catch': function (handler) {\n return this.getPromise()['catch'](handler);\n },\n 'finally': function (handler) {\n return this.getPromise()['finally'](handler);\n },\n pause: function () {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n resume: function () {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n end: function () {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n cancel: function () {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n complete: function (response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._tick(function () {\n self._resolve(response);\n });\n }\n },\n _resolve: function (response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function (fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n return AnimateRunner;\n }];\n };\n\n /* exported $CoreAnimateCssProvider */\n\n /**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n * @this\n *\n * @description\n * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,\n * then the `$animateCss` service will actually perform animations.\n *\n * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.\n */\n var $CoreAnimateCssProvider = function () {\n this.$get = ['$$rAF', '$q', '$$AnimateRunner', function ($$rAF, $q, $$AnimateRunner) {\n return function (element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = copy(options);\n }\n\n // there is no point in applying the styles since\n // there is no animation that goes on at all in\n // this version of $animateCss.\n if (options.cleanupStyles) {\n options.from = options.to = null;\n }\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n var closed,\n runner = new $$AnimateRunner();\n return {\n start: run,\n end: run\n };\n function run() {\n $$rAF(function () {\n applyAnimationContents();\n if (!closed) {\n runner.complete();\n }\n closed = true;\n });\n return runner;\n }\n function applyAnimationContents() {\n if (options.addClass) {\n element.addClass(options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n element.removeClass(options.removeClass);\n options.removeClass = null;\n }\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n };\n }];\n };\n\n /* global getHash: true, stripHash: false */\n\n function getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n }\n function trimEmptyHash(url) {\n return url.replace(/#$/, '');\n }\n\n /**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n /**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\n function Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {\n var self = this,\n location = window.location,\n history = window.history,\n setTimeout = window.setTimeout,\n clearTimeout = window.clearTimeout,\n pendingDeferIds = {},\n taskTracker = $$taskTrackerFactory($log);\n self.isMock = false;\n\n //////////////////////////////////////////////////////////////\n // Task-tracking API\n //////////////////////////////////////////////////////////////\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = taskTracker.completeTask;\n self.$$incOutstandingRequestCount = taskTracker.incTaskCount;\n\n // TODO(vojta): prefix this method with $$ ?\n self.notifyWhenNoOutstandingRequests = taskTracker.notifyWhenNoPendingTasks;\n\n //////////////////////////////////////////////////////////////\n // URL API\n //////////////////////////////////////////////////////////////\n\n var cachedState,\n lastHistoryState,\n lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n pendingLocation = null,\n getCurrentState = !$sniffer.history ? noop : function getCurrentState() {\n try {\n return history.state;\n } catch (e) {\n // MSIE can reportedly throw when there is no state (UNCONFIRMED).\n }\n };\n cacheState();\n\n /**\n * @name $browser#url\n *\n * @description\n * GETTER:\n * Without any argument, this method just returns current value of `location.href` (with a\n * trailing `#` stripped of if the hash is empty).\n *\n * SETTER:\n * With at least one argument, this method sets url to new value.\n * If html5 history api supported, `pushState`/`replaceState` is used, otherwise\n * `location.href`/`location.replace` is used.\n * Returns its own instance to allow chaining.\n *\n * NOTE: this api is intended for use only by the `$location` service. Please use the\n * {@link ng.$location $location service} to change url.\n *\n * @param {string} url New url (when used as setter)\n * @param {boolean=} replace Should new url replace current history record?\n * @param {object=} state State object to use with `pushState`/`replaceState`\n */\n self.url = function (url, replace, state) {\n // In modern browsers `history.state` is `null` by default; treating it separately\n // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n if (isUndefined(state)) {\n state = null;\n }\n\n // Android Browser BFCache causes location, history reference to become stale.\n if (location !== window.location) location = window.location;\n if (history !== window.history) history = window.history;\n\n // setter\n if (url) {\n var sameState = lastHistoryState === state;\n\n // Normalize the inputted URL\n url = urlResolve(url).href;\n\n // Don't change anything if previous and current URLs and states match. This also prevents\n // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n // See https://github.com/angular/angular.js/commit/ffb2701\n if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n return self;\n }\n var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n lastBrowserUrl = url;\n lastHistoryState = state;\n // Don't use history API if only the hash changed\n // due to a bug in IE10/IE11 which leads\n // to not firing a `hashchange` nor `popstate` event\n // in some cases (see #9143).\n if ($sniffer.history && (!sameBase || !sameState)) {\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\n cacheState();\n } else {\n if (!sameBase) {\n pendingLocation = url;\n }\n if (replace) {\n location.replace(url);\n } else if (!sameBase) {\n location.href = url;\n } else {\n location.hash = getHash(url);\n }\n if (location.href !== url) {\n pendingLocation = url;\n }\n }\n if (pendingLocation) {\n pendingLocation = url;\n }\n return self;\n // getter\n } else {\n // - pendingLocation is needed as browsers don't allow to read out\n // the new location.href if a reload happened or if there is a bug like in iOS 9 (see\n // https://openradar.appspot.com/22186109).\n return trimEmptyHash(pendingLocation || location.href);\n }\n };\n\n /**\n * @name $browser#state\n *\n * @description\n * This method is a getter.\n *\n * Return history.state or null if history.state is undefined.\n *\n * @returns {object} state\n */\n self.state = function () {\n return cachedState;\n };\n var urlChangeListeners = [],\n urlChangeInit = false;\n function cacheStateAndFireUrlChange() {\n pendingLocation = null;\n fireStateOrUrlChange();\n }\n\n // This variable should be used *only* inside the cacheState function.\n var lastCachedState = null;\n function cacheState() {\n // This should be the only place in $browser where `history.state` is read.\n cachedState = getCurrentState();\n cachedState = isUndefined(cachedState) ? null : cachedState;\n\n // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n if (equals(cachedState, lastCachedState)) {\n cachedState = lastCachedState;\n }\n lastCachedState = cachedState;\n lastHistoryState = cachedState;\n }\n function fireStateOrUrlChange() {\n var prevLastHistoryState = lastHistoryState;\n cacheState();\n if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) {\n return;\n }\n lastBrowserUrl = self.url();\n lastHistoryState = cachedState;\n forEach(urlChangeListeners, function (listener) {\n listener(self.url(), cachedState);\n });\n }\n\n /**\n * @name $browser#onUrlChange\n *\n * @description\n * Register callback function that will be called, when url changes.\n *\n * It's only called when the url is changed from outside of AngularJS:\n * - user types different url into address bar\n * - user clicks on history (forward/back) button\n * - user clicks on a link\n *\n * It's not called when url is changed by $browser.url() method\n *\n * The listener gets called with new url as parameter.\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to monitor url changes in AngularJS apps.\n *\n * @param {function(string)} listener Listener function to be called when url changes.\n * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n */\n self.onUrlChange = function (callback) {\n // TODO(vojta): refactor to use node's syntax for events\n if (!urlChangeInit) {\n // We listen on both (hashchange/popstate) when available, as some browsers don't\n // fire popstate when user changes the address bar and don't fire hashchange when url\n // changed by push/replaceState\n\n // html5 history api - popstate event\n if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n // hashchange event\n jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n urlChangeInit = true;\n }\n urlChangeListeners.push(callback);\n return callback;\n };\n\n /**\n * @private\n * Remove popstate and hashchange handler from window.\n *\n * NOTE: this api is intended for use only by $rootScope.\n */\n self.$$applicationDestroyed = function () {\n jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);\n };\n\n /**\n * Checks whether the url has changed outside of AngularJS.\n * Needs to be exported to be able to check for changes that have been done in sync,\n * as hashchange/popstate events fire in async.\n */\n self.$$checkUrlChange = fireStateOrUrlChange;\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name $browser#baseHref\n *\n * @description\n * Returns current \n * (always relative - without domain)\n *\n * @returns {string} The current base href\n */\n self.baseHref = function () {\n var href = baseElement.attr('href');\n return href ? href.replace(/^(https?:)?\\/\\/[^/]*/, '') : '';\n };\n\n /**\n * @name $browser#defer\n * @param {function()} fn A function, who's execution should be deferred.\n * @param {number=} [delay=0] Number of milliseconds to defer the function execution.\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] The type of task that is deferred.\n * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n *\n * @description\n * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n *\n * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n * via `$browser.defer.flush()`.\n *\n */\n self.defer = function (fn, delay, taskType) {\n var timeoutId;\n delay = delay || 0;\n taskType = taskType || taskTracker.DEFAULT_TASK_TYPE;\n taskTracker.incTaskCount(taskType);\n timeoutId = setTimeout(function () {\n delete pendingDeferIds[timeoutId];\n taskTracker.completeTask(fn, taskType);\n }, delay);\n pendingDeferIds[timeoutId] = taskType;\n return timeoutId;\n };\n\n /**\n * @name $browser#defer.cancel\n *\n * @description\n * Cancels a deferred task identified with `deferId`.\n *\n * @param {*} deferId Token returned by the `$browser.defer` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n self.defer.cancel = function (deferId) {\n if (pendingDeferIds.hasOwnProperty(deferId)) {\n var taskType = pendingDeferIds[deferId];\n delete pendingDeferIds[deferId];\n clearTimeout(deferId);\n taskTracker.completeTask(noop, taskType);\n return true;\n }\n return false;\n };\n }\n\n /** @this */\n function $BrowserProvider() {\n this.$get = ['$window', '$log', '$sniffer', '$document', '$$taskTrackerFactory', function ($window, $log, $sniffer, $document, $$taskTrackerFactory) {\n return new Browser($window, $document, $log, $sniffer, $$taskTrackerFactory);\n }];\n }\n\n /**\n * @ngdoc service\n * @name $cacheFactory\n * @this\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n * var cache = $cacheFactory('cacheId');\n * expect($cacheFactory.get('cacheId')).toBe(cache);\n * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n * cache.put(\"key\", \"value\");\n * cache.put(\"another key\", \"another value\");\n *\n * // We've specified no options on creation\n * expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n * - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n * it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n \n \n
\n \n \n \n \n

Cached Values

\n
\n \n : \n \n
\n \n

Cache Info

\n
\n \n : \n \n
\n
\n
\n \n angular.module('cacheExampleApp', []).\n controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n $scope.keys = [];\n $scope.cache = $cacheFactory('cacheId');\n $scope.put = function(key, value) {\n if (angular.isUndefined($scope.cache.get(key))) {\n $scope.keys.push(key);\n }\n $scope.cache.put(key, angular.isUndefined(value) ? null : value);\n };\n }]);\n \n \n p {\n margin: 10px 0 3px;\n }\n \n
\n */\n function $CacheFactoryProvider() {\n this.$get = function () {\n var caches = {};\n function cacheFactory(cacheId, options) {\n if (cacheId in caches) {\n throw minErr('$cacheFactory')('iid', 'CacheId \\'{0}\\' is already taken!', cacheId);\n }\n var size = 0,\n stats = extend({}, options, {\n id: cacheId\n }),\n data = createMap(),\n capacity = options && options.capacity || Number.MAX_VALUE,\n lruHash = createMap(),\n freshEnd = null,\n staleEnd = null;\n\n /**\n * @ngdoc type\n * @name $cacheFactory.Cache\n *\n * @description\n * A cache object used to store and retrieve data, primarily used by\n * {@link $templateRequest $templateRequest} and the {@link ng.directive:script script}\n * directive to cache templates and other data.\n *\n * ```js\n * angular.module('superCache')\n * .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n * return $cacheFactory('super-cache');\n * }]);\n * ```\n *\n * Example test:\n *\n * ```js\n * it('should behave like a cache', inject(function(superCache) {\n * superCache.put('key', 'value');\n * superCache.put('another key', 'another value');\n *\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 2\n * });\n *\n * superCache.remove('another key');\n * expect(superCache.get('another key')).toBeUndefined();\n *\n * superCache.removeAll();\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 0\n * });\n * }));\n * ```\n */\n return caches[cacheId] = {\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#put\n * @kind function\n *\n * @description\n * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n * retrieved later, and incrementing the size of the cache if the key was not already\n * present in the cache. If behaving like an LRU cache, it will also remove stale\n * entries from the set.\n *\n * It will not insert undefined values into the cache.\n *\n * @param {string} key the key under which the cached data is stored.\n * @param {*} value the value to store alongside the key. If it is undefined, the key\n * will not be stored.\n * @returns {*} the value stored.\n */\n put: function (key, value) {\n if (isUndefined(value)) return;\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key] || (lruHash[key] = {\n key: key\n });\n refresh(lruEntry);\n }\n if (!(key in data)) size++;\n data[key] = value;\n if (size > capacity) {\n this.remove(staleEnd.key);\n }\n return value;\n },\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#get\n * @kind function\n *\n * @description\n * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the data to be retrieved\n * @returns {*} the value stored.\n */\n get: function (key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n if (!lruEntry) return;\n refresh(lruEntry);\n }\n return data[key];\n },\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#remove\n * @kind function\n *\n * @description\n * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the entry to be removed\n */\n remove: function (key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n if (!lruEntry) return;\n if (lruEntry === freshEnd) freshEnd = lruEntry.p;\n if (lruEntry === staleEnd) staleEnd = lruEntry.n;\n link(lruEntry.n, lruEntry.p);\n delete lruHash[key];\n }\n if (!(key in data)) return;\n delete data[key];\n size--;\n },\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#removeAll\n * @kind function\n *\n * @description\n * Clears the cache object of any entries.\n */\n removeAll: function () {\n data = createMap();\n size = 0;\n lruHash = createMap();\n freshEnd = staleEnd = null;\n },\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#destroy\n * @kind function\n *\n * @description\n * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n * removing it from the {@link $cacheFactory $cacheFactory} set.\n */\n destroy: function () {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#info\n * @kind function\n *\n * @description\n * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n *\n * @returns {object} an object with the following properties:\n *
    \n *
  • **id**: the id of the cache instance
  • \n *
  • **size**: the number of entries kept in the cache instance
  • \n *
  • **...**: any additional properties from the options object when creating the\n * cache.
  • \n *
\n */\n info: function () {\n return extend({}, stats, {\n size: size\n });\n }\n };\n\n /**\n * makes the `entry` the freshEnd of the LRU linked list\n */\n function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }\n\n /**\n * bidirectionally links two entries of the LRU linked list\n */\n function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }\n }\n\n /**\n * @ngdoc method\n * @name $cacheFactory#info\n *\n * @description\n * Get information about all the caches that have been created\n *\n * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n */\n cacheFactory.info = function () {\n var info = {};\n forEach(caches, function (cache, cacheId) {\n info[cacheId] = cache.info();\n });\n return info;\n };\n\n /**\n * @ngdoc method\n * @name $cacheFactory#get\n *\n * @description\n * Get access to a cache object by the `cacheId` used when it was created.\n *\n * @param {string} cacheId Name or id of a cache to access.\n * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n */\n cacheFactory.get = function (cacheId) {\n return caches[cacheId];\n };\n return cacheFactory;\n };\n }\n\n /**\n * @ngdoc service\n * @name $templateCache\n * @this\n *\n * @description\n * `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the\n * {@link ng.$cacheFactory $cacheFactory}.\n *\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, by using {@link $templateRequest},\n * or by consuming the `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * \n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g.\n * element with {@link ngApp} attribute), otherwise the template will be ignored.\n *\n * Adding via the `$templateCache` service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n * $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your component:\n * ```js\n * myApp.component('myComponent', {\n * templateUrl: 'templateId.html'\n * });\n * ```\n *\n * or get it via the `$templateCache` service:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n */\n function $TemplateCacheProvider() {\n this.$get = ['$cacheFactory', function ($cacheFactory) {\n return $cacheFactory('templates');\n }];\n }\n\n /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables like document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n /* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" - function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n /**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n *
\n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n *
\n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)}\n * that defines the directive properties, or just the `postLink` function (all other properties will have\n * the default values).\n *\n *
\n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n *
\n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * {@link $compile#-priority- priority}: 0,\n * {@link $compile#-template- template}: '
', // or // function(tElement, tAttrs) { ... },\n * // or\n * // {@link $compile#-templateurl- templateUrl}: 'directive.html', // or // function(tElement, tAttrs) { ... },\n * {@link $compile#-transclude- transclude}: false,\n * {@link $compile#-restrict- restrict}: 'A',\n * {@link $compile#-templatenamespace- templateNamespace}: 'html',\n * {@link $compile#-scope- scope}: false,\n * {@link $compile#-controller- controller}: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n * {@link $compile#-controlleras- controllerAs}: 'stringIdentifier',\n * {@link $compile#-bindtocontroller- bindToController}: false,\n * {@link $compile#-require- require}: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n * {@link $compile#-multielement- multiElement}: false,\n * {@link $compile#-compile- compile}: function compile(tElement, tAttrs, transclude) {\n * return {\n * {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * }\n * // or\n * // return function postLink( ... ) { ... }\n * },\n * // or\n * // {@link $compile#-link- link}: {\n * // {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * // {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * // }\n * // or\n * // {@link $compile#-link- link}: function postLink( ... ) { ... }\n * };\n * return directiveDefinitionObject;\n * });\n * ```\n *\n *
\n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n *
\n *\n * Therefore the above can be simplified as:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * link: function postLink(scope, iElement, iAttrs) { ... }\n * };\n * return directiveDefinitionObject;\n * // or\n * // return function postLink(scope, iElement, iAttrs) { ... }\n * });\n * ```\n *\n * ### Life-cycle hooks\n * Directive controllers can provide the following methods that are called by AngularJS at points in the life-cycle of the\n * directive:\n * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and\n * had their bindings initialized (and before the pre & post linking functions for the directives on\n * this element). This is a good place to put initialization code for your controller.\n * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The\n * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an\n * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a\n * component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will\n * also be called when your bindings are initialized.\n * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on\n * changes. Any actions that you wish to take in response to the changes that you detect must be\n * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook\n * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not\n * be detected by AngularJS's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments;\n * if detecting changes, you must store the previous value(s) for comparison to the current values.\n * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing\n * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in\n * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent\n * components will have their `$onDestroy()` hook called before child components.\n * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link\n * function this hook can be used to set up DOM event handlers and do direct DOM manipulation.\n * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since\n * they are waiting for their template to load asynchronously and their own compilation and linking has been\n * suspended until that occurs.\n *\n * #### Comparison with life-cycle hooks in the new Angular\n * The new Angular also uses life-cycle hooks for its components. While the AngularJS life-cycle hooks are similar there are\n * some differences that you should be aware of, especially when it comes to moving your code from AngularJS to Angular:\n *\n * * AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`.\n * * AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor.\n * In Angular you can only define hooks on the prototype of the Component class.\n * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in AngularJS than you would to\n * `ngDoCheck` in Angular.\n * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be\n * propagated throughout the application.\n * Angular does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an\n * error or do nothing depending upon the state of `enableProdMode()`.\n *\n * #### Life-cycle hook examples\n *\n * This example shows how you can check for mutations to a Date object even though the identity of the object\n * has not changed.\n *\n * \n * \n * angular.module('do-check-module', [])\n * .component('app', {\n * template:\n * 'Month: ' +\n * 'Date: {{ $ctrl.date }}' +\n * '',\n * controller: function() {\n * this.date = new Date();\n * this.month = this.date.getMonth();\n * this.updateDate = function() {\n * this.date.setMonth(this.month);\n * };\n * }\n * })\n * .component('test', {\n * bindings: { date: '<' },\n * template:\n * '
{{ $ctrl.log | json }}
',\n * controller: function() {\n * var previousValue;\n * this.log = [];\n * this.$doCheck = function() {\n * var currentValue = this.date && this.date.valueOf();\n * if (previousValue !== currentValue) {\n * this.log.push('doCheck: date mutated: ' + this.date);\n * previousValue = currentValue;\n * }\n * };\n * }\n * });\n *
\n * \n * \n * \n *
\n *\n * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the\n * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large\n * arrays or objects can have a negative impact on your application performance.)\n *\n * \n * \n *
\n * \n * \n *
{{ items }}
\n * \n *
\n *
\n * \n * angular.module('do-check-module', [])\n * .component('test', {\n * bindings: { items: '<' },\n * template:\n * '
{{ $ctrl.log | json }}
',\n * controller: function() {\n * this.log = [];\n *\n * this.$doCheck = function() {\n * if (this.items_ref !== this.items) {\n * this.log.push('doCheck: items changed');\n * this.items_ref = this.items;\n * }\n * if (!angular.equals(this.items_clone, this.items)) {\n * this.log.push('doCheck: items mutated');\n * this.items_clone = angular.copy(this.items);\n * }\n * };\n * }\n * });\n *
\n *
\n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true (default is `false`), the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioral (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * The scope property can be `false`, `true`, or an object:\n *\n * * **`false` (default):** No scope will be created for the directive. The directive will use its\n * parent's scope.\n *\n * * **`true`:** A new child scope that prototypically inherits from its parent will be created for\n * the directive's element. If multiple directives on the same element request a new scope,\n * only one new scope is created.\n *\n * * **`{...}` (an object hash):** A new \"isolate\" scope is created for the directive's template.\n * The 'isolate' scope differs from normal scope in that it does not prototypically\n * inherit from its parent scope. This is useful when creating reusable components, which should not\n * accidentally read or modify data in the parent scope. Note that an isolate scope\n * directive without a `template` or `templateUrl` will not apply the isolate scope\n * to its children elements.\n *\n * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the\n * directive's element. These local properties are useful for aliasing values for templates. The keys in\n * the object hash map to the name of the property on the isolate scope; the values define how the property\n * is bound to the parent scope, via matching attributes on the directive's element:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n * always a string since DOM attributes are strings. If no `attr` name is specified then the\n * attribute name is assumed to be the same as the local name. Given `` and the isolate scope definition `scope: { localName:'@myAttr' }`,\n * the directive's scope property `localName` will reflect the interpolated value of `hello\n * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's\n * scope. The `name` is read from the parent scope (not the directive's scope).\n *\n * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression\n * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.\n * If no `attr` name is specified then the attribute name is assumed to be the same as the local\n * name. Given `` and the isolate scope definition `scope: {\n * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the\n * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in\n * `localModel` and vice versa. If the binding expression is non-assignable, or if the attribute\n * isn't optional and doesn't exist, an exception\n * ({@link error/$compile/nonassign `$compile:nonassign`}) will be thrown upon discovering changes\n * to the local value, since it will be impossible to sync them back to the parent scope.\n *\n * By default, the {@link ng.$rootScope.Scope#$watch `$watch`}\n * method is used for tracking changes, and the equality check is based on object identity.\n * However, if an object literal or an array literal is passed as the binding expression, the\n * equality check is done by value (using the {@link angular.equals} function). It's also possible\n * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection\n * `$watchCollection`}: use `=*` or `=*attr`\n *\n * * `<` or `` and directive definition of\n * `scope: { localModel:'` and the isolate scope definition `scope: {\n * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for\n * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope\n * via an expression to the parent scope. This can be done by passing a map of local variable names\n * and values into the expression wrapper fn. For example, if the expression is `increment(amount)`\n * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.\n *\n * All 4 kinds of bindings (`@`, `=`, `<`, and `&`) can be made optional by adding `?` to the expression.\n * The marker must come after the mode and before the attribute name.\n * See the {@link error/$compile/iscp Invalid Isolate Scope Definition error} for definition examples.\n * This is useful to refine the interface directives provide.\n * One subtle difference between optional and non-optional happens **when the binding attribute is not\n * set**:\n * - the binding is optional: the property will not be defined\n * - the binding is not optional: the property is defined\n *\n * ```js\n *app.directive('testDir', function() {\n return {\n scope: {\n notoptional: '=',\n optional: '=?',\n },\n bindToController: true,\n controller: function() {\n this.$onInit = function() {\n console.log(this.hasOwnProperty('notoptional')) // true\n console.log(this.hasOwnProperty('optional')) // false\n }\n }\n }\n })\n *```\n *\n *\n * ##### Combining directives with different scope defintions\n *\n * In general it's possible to apply more than one directive to one element, but there might be limitations\n * depending on the type of scope required by the directives. The following points will help explain these limitations.\n * For simplicity only two directives are taken into account, but it is also applicable for several directives:\n *\n * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope\n * * **child scope** + **no scope** => Both directives will share one single child scope\n * * **child scope** + **child scope** => Both directives will share one single child scope\n * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use\n * its parent's scope\n * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot\n * be applied to the same element.\n * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives\n * cannot be applied to the same element.\n *\n *\n * #### `bindToController`\n * This property is used to bind scope properties directly to the controller. It can be either\n * `true` or an object hash with the same format as the `scope` property.\n *\n * When an isolate scope is used for a directive (see above), `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope.\n *\n * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller\n * properties. You can access these bindings once they have been initialized by providing a controller method called\n * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings\n * initialized.\n *\n * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.\n * This will set up the scope bindings to the controller directly. Note that `scope` can still be used\n * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate\n * scope (useful for component directives).\n *\n * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.\n *\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and can be accessed by other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n * `function([scope], cloneLinkingFn, futureParentElement, slotName)`:\n * * `scope`: (optional) override the scope.\n * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.\n * * `futureParentElement` (optional):\n * * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n * and when the `cloneLinkingFn` is passed,\n * as those elements need to created and cloned in a special way when they are defined outside their\n * usual containers (e.g. like ``).\n * * See also the `directive.templateNamespace` property.\n * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)\n * then the default transclusion is provided.\n * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns\n * `true` if the specified slot contains content (i.e. one or more DOM nodes).\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` property can be a string, an array or an object:\n * * a **string** containing the name of the directive to pass to the linking function\n * * an **array** containing the names of directives to pass to the linking function. The argument passed to the\n * linking function will be an array of controllers in the same order as the names in the `require` property\n * * an **object** whose property values are the names of the directives to pass to the linking function. The argument\n * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding\n * controllers.\n *\n * If the `require` property is an object and `bindToController` is truthy, then the required controllers are\n * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers\n * have been constructed but before `$onInit` is called.\n * If the name of the required controller is the same as the local name (the key), the name can be\n * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`.\n * See the {@link $compileProvider#component} helper for an example of how this can be used.\n * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is\n * raised (unless no link function is specified and the required controllers are not being bound to the directive\n * controller, in which case error checking is skipped). The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n * `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n * `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Identifier name for a reference to the controller in the directive's scope.\n * This allows the controller to be referenced from the directive template. This is especially\n * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible\n * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the\n * `controllerAs` reference might overwrite a property that already exists on the parent scope.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): ``\n * * `A` - Attribute (default): `
`\n * * `C` - Class: `
`\n * * `M` - Comment: ``\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `` and ``.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `` or ``.\n * * `svg` - The root nodes in the template are SVG elements (excluding ``).\n * * `math` - The root nodes in the template are MathML elements (excluding ``).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `
{{delete_str}}
`.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n * function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved. In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}.\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url. In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace`\n *
\n * **Note:** `replace` is deprecated in AngularJS and has been removed in the new Angular (v2+).\n *
\n *\n * Specifies what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n *\n * #### `compile`\n *\n * ```js\n * function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n * * `tElement` - template element - The element where the directive has been declared. It is\n * safe to do template transformation on the element and child elements only.\n *\n * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n * between all directive compile functions.\n *\n * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n *
\n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n *
\n \n *
\n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and\n * stack overflow errors.\n *\n * This can be avoided by manually using `$compile` in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n *
\n *\n *
\n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n * e.g. does not know about the right outer scope. Please use the transclude function that is passed\n * to the link function instead.\n *
\n \n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n * `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n * control when a linking function should be called during the linking phase. See info about\n * pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n * * `iElement` - instance element - The element where the directive is to be used. It is safe to\n * manipulate the children of the element only in `postLink` function since the children have\n * already been linked.\n *\n * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n * between all directive linking functions.\n *\n * * `controller` - the directive's required controller instance(s) - Instances are shared\n * among all directives, which allows the directives to use the controllers as a communication\n * channel. The exact value depends on the directive's `require` property:\n * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one\n * * `string`: the controller instance\n * * `array`: array of controller instances\n *\n * If a required controller cannot be found, and it is optional, the instance is `null`,\n * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.\n *\n * Note that you can also require the directive's own controller - it will be made available like\n * any other controller.\n *\n * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n * This is the same as the `$transclude` parameter of directive controllers,\n * see {@link ng.$compile#-controller- the controller section for details}.\n * `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n *
\n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n *
\n *\n * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element, the entire element or multiple parts of the element contents:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n * element that are defined at a lower priority than this directive. When used, the `template`\n * property is ignored.\n * * **`{...}` (an object hash):** - map elements of the content onto transclusion \"slots\" in the template.\n *\n * **Multi-slot transclusion** is declared by providing an object for the `transclude` property.\n *\n * This object is a map where the keys are the name of the slot to fill and the value is an element selector\n * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)\n * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}.\n *\n * If the element selector is prefixed with a `?` then that slot is optional.\n *\n * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `` elements to\n * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.\n *\n * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements\n * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call\n * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and\n * injectable into the directive's controller.\n *\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n *
\n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n *
\n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, which the clone will be linked to.\n *\n *
\n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n *
\n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n * element.append(clone);\n * transcludedContent = clone;\n * transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n *
\n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n *
\n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transcluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n *
\n *
\n *
\n *
\n *
\n *
\n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n ```\n - $rootScope\n - isolate\n - transclusion\n ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n ```\n - $rootScope\n - transclusion\n - isolate\n ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * * *Accessing normalized attribute names:* Directives like `ngBind` can be expressed in many ways:\n * `ng:bind`, `data-ng-bind`, or `x-ng-bind`. The attributes object allows for normalized access\n * to the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n * object which allows the directives to use the attributes object as inter directive\n * communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n * allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n * that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n * the only way to easily get the actual value because during the linking phase the interpolation\n * hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n * // get the attribute value\n * console.log(attrs.ngModel);\n *\n * // change the attribute\n * attrs.$set('ngModel', 'new value');\n *\n * // observe changes to interpolated attribute\n * attrs.$observe('ngModel', function(value) {\n * console.log('ngModel has changed value to ' + value);\n * });\n * }\n * ```\n *\n * ## Example\n *\n *
\n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n *
\n *\n \n \n \n
\n
\n
\n
\n
\n
\n \n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello AngularJS'.\n expect(output.getText()).toBe('Hello AngularJS');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('AngularJS!');\n });\n \n
\n \n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n *
\n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n * e.g. will not use the right outer scope. Please pass the transclude function as a\n * `parentBoundTranscludeFn` to the link function instead.\n *
\n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n * `template` and call the `cloneAttachFn` function allowing the caller to attach the\n * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n * called as:
`cloneAttachFn(clonedElement, scope)` where:\n *\n * * `clonedElement` - is a clone of the original `element` passed into the compiler.\n * * `scope` - is the current scope with which the linking function is working with.\n *\n * * `options` - An optional object hash with linking options. If `options` is provided, then the following\n * keys may be used to control linking behavior:\n *\n * * `parentBoundTranscludeFn` - the transclude function made available to\n * directives; if given, it will be passed through to the link functions of\n * directives found in `element` during compilation.\n * * `transcludeControllers` - an object hash with keys that map controller names\n * to a hash with the key `instance`, which maps to the controller instance;\n * if given, it will make the controllers available to directives on the compileNode:\n * ```\n * {\n * parent: {\n * instance: parentControllerInstance\n * }\n * }\n * ```\n * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n * the cloned elements; only needed for transcludes that are allowed to contain non HTML\n * elements (e.g. SVG elements). See also the `directive.controller` property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to `$digest`, which typically is done by\n * AngularJS automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n * before you send them to the compiler and keep this reference around.\n * ```js\n * var element = angular.element('

{{total}}

');\n * $compile(element)(scope);\n * ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n * example would not point to the clone, but rather to the original template that was cloned. In\n * this case, you can access the clone either via the `cloneAttachFn` or the value returned by the\n * linking function:\n * ```js\n * var templateElement = angular.element('

{{total}}

');\n * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n * // Attach the clone to DOM document at the right place.\n * });\n *\n * // Now we have reference to the cloned DOM via `clonedElement`.\n * // NOTE: The `clonedElement` returned by the linking function is the same as the\n * // `clonedElement` passed to `cloneAttachFn`.\n * ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler AngularJS HTML Compiler} section of the Developer Guide.\n *\n * @knownIssue\n *\n * ### Double Compilation\n *\n Double compilation occurs when an already compiled part of the DOM gets\n compiled again. This is an undesired effect and can lead to misbehaving directives, performance issues,\n and memory leaks. Refer to the Compiler Guide {@link guide/compiler#double-compilation-and-how-to-avoid-it\n section on double compilation} for an in-depth explanation and ways to avoid it.\n \n * @knownIssue\n \n ### Issues with `replace: true`\n *\n *
\n * **Note**: {@link $compile#-replace- `replace: true`} is deprecated and not recommended to use,\n * mainly due to the issues listed here. It has been completely removed in the new Angular.\n *
\n *\n * #### Attribute values are not merged\n *\n * When a `replace` directive encounters the same attribute on the original and the replace node,\n * it will simply deduplicate the attribute and join the values with a space or with a `;` in case of\n * the `style` attribute.\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * That means attributes that contain AngularJS expressions will not be merged correctly, e.g.\n * {@link ngShow} or {@link ngClass} will cause a {@link $parse} error:\n *\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * See issue [#5695](https://github.com/angular/angular.js/issues/5695).\n *\n * #### Directives are not deduplicated before compilation\n *\n * When the original node and the replace template declare the same directive(s), they will be\n * {@link guide/compiler#double-compilation-and-how-to-avoid-it compiled twice} because the compiler\n * does not deduplicate them. In many cases, this is not noticeable, but e.g. {@link ngModel} will\n * attach `$formatters` and `$parsers` twice.\n *\n * See issue [#2573](https://github.com/angular/angular.js/issues/2573).\n *\n * #### `transclude: element` in the replace template root can have unexpected effects\n *\n * When the replace template has a directive at the root node that uses\n * {@link $compile#-transclude- `transclude: element`}, e.g.\n * {@link ngIf} or {@link ngRepeat}, the DOM structure or scope inheritance can be incorrect.\n * See the following issues:\n *\n * - Incorrect scope on replaced element:\n * [#9837](https://github.com/angular/angular.js/issues/9837)\n * - Different DOM between `template` and `templateUrl`:\n * [#10612](https://github.com/angular/angular.js/issues/14326)\n *\n */\n\n /**\n * @ngdoc directive\n * @name ngProp\n * @restrict A\n * @element ANY\n *\n * @usage\n *\n * ```html\n * \n * \n * ```\n *\n * or with uppercase letters in property (e.g. \"propName\"):\n *\n *\n * ```html\n * \n * \n * ```\n *\n *\n * @description\n * The `ngProp` directive binds an expression to a DOM element property.\n * `ngProp` allows writing to arbitrary properties by including\n * the property name in the attribute, e.g. `ng-prop-value=\"'my value'\"` binds 'my value' to\n * the `value` property.\n *\n * Usually, it's not necessary to write to properties in AngularJS, as the built-in directives\n * handle the most common use cases (instead of the above example, you would use {@link ngValue}).\n *\n * However, [custom elements](https://developer.mozilla.org/docs/Web/Web_Components/Using_custom_elements)\n * often use custom properties to hold data, and `ngProp` can be used to provide input to these\n * custom elements.\n *\n * ## Binding to camelCase properties\n *\n * Since HTML attributes are case-insensitive, camelCase properties like `innerHTML` must be escaped.\n * AngularJS uses the underscore (_) in front of a character to indicate that it is uppercase, so\n * `innerHTML` must be written as `ng-prop-inner_h_t_m_l=\"expression\"` (Note that this is just an\n * example, and for binding HTML {@link ngBindHtml} should be used.\n *\n * ## Security\n *\n * Binding expressions to arbitrary properties poses a security risk, as properties like `innerHTML`\n * can insert potentially dangerous HTML into the application, e.g. script tags that execute\n * malicious code.\n * For this reason, `ngProp` applies Strict Contextual Escaping with the {@link ng.$sce $sce service}.\n * This means vulnerable properties require their content to be \"trusted\", based on the\n * context of the property. For example, the `innerHTML` is in the `HTML` context, and the\n * `iframe.src` property is in the `RESOURCE_URL` context, which requires that values written to\n * this property are trusted as a `RESOURCE_URL`.\n *\n * This can be set explicitly by calling $sce.trustAs(type, value) on the value that is\n * trusted before passing it to the `ng-prop-*` directive. There are exist shorthand methods for\n * each context type in the form of {@link ng.$sce#trustAsResourceUrl $sce.trustAsResourceUrl()} et al.\n *\n * In some cases you can also rely upon automatic sanitization of untrusted values - see below.\n *\n * Based on the context, other options may exist to mark a value as trusted / configure the behavior\n * of {@link ng.$sce}. For example, to restrict the `RESOURCE_URL` context to specific origins, use\n * the {@link $sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList()}\n * and {@link $sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList()}.\n *\n * {@link ng.$sce#what-trusted-context-types-are-supported- Find out more about the different context types}.\n *\n * ### HTML Sanitization\n *\n * By default, `$sce` will throw an error if it detects untrusted HTML content, and will not bind the\n * content.\n * However, if you include the {@link ngSanitize ngSanitize module}, it will try to sanitize the\n * potentially dangerous HTML, e.g. strip non-trusted tags and attributes when binding to\n * `innerHTML`.\n *\n * @example\n * ### Binding to different contexts\n *\n * \n * \n * angular.module('exampleNgProp', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function($sce) {\n * this.safeContent = 'Safe content';\n * this.unsafeContent = '';\n * this.trustedUnsafeContent = $sce.trustAsHtml(this.unsafeContent);\n * }\n * });\n * \n * \n *
\n *
\n * Binding to a property without security context:\n *
\n * innerText (safeContent)\n *
\n *\n *
\n * \"Safe\" content that requires a security context will throw because the contents could potentially be dangerous ...\n *
\n * innerHTML (safeContent)\n *
\n *\n *
\n * ... so that actually dangerous content cannot be executed:\n *
\n * innerHTML (unsafeContent)\n *
\n *\n *
\n * ... but unsafe Content that has been trusted explicitly works - only do this if you are 100% sure!\n *
\n * innerHTML (trustedUnsafeContent)\n *
\n *
\n *
\n * \n *
\n *
\n * \n * .prop-unit {\n * margin-bottom: 10px;\n * }\n *\n * .prop-binding {\n * min-height: 30px;\n * border: 1px solid blue;\n * }\n *\n * .prop-note {\n * font-family: Monospace;\n * }\n * \n *
\n *\n *\n * @example\n * ### Binding to innerHTML with ngSanitize\n *\n * \n * \n * angular.module('exampleNgProp', ['ngSanitize'])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function($sce) {\n * this.safeContent = 'Safe content';\n * this.unsafeContent = '';\n * this.trustedUnsafeContent = $sce.trustAsHtml(this.unsafeContent);\n * }\n * });\n * \n * \n *
\n *
\n * \"Safe\" content will be sanitized ...\n *
\n * innerHTML (safeContent)\n *
\n *\n *
\n * ... as will dangerous content:\n *
\n * innerHTML (unsafeContent)\n *
\n *\n *
\n * ... and content that has been trusted explicitly works the same as without ngSanitize:\n *
\n * innerHTML (trustedUnsafeContent)\n *
\n *
\n *
\n * \n *
\n *
\n * \n * .prop-unit {\n * margin-bottom: 10px;\n * }\n *\n * .prop-binding {\n * min-height: 30px;\n * border: 1px solid blue;\n * }\n *\n * .prop-note {\n * font-family: Monospace;\n * }\n * \n *
\n *\n */\n\n /** @ngdoc directive\n * @name ngOn\n * @restrict A\n * @element ANY\n *\n * @usage\n *\n * ```html\n * \n * \n * ```\n *\n * or with uppercase letters in property (e.g. \"eventName\"):\n *\n *\n * ```html\n * \n * \n * ```\n *\n * @description\n * The `ngOn` directive adds an event listener to a DOM element via\n * {@link angular.element angular.element().on()}, and evaluates an expression when the event is\n * fired.\n * `ngOn` allows adding listeners for arbitrary events by including\n * the event name in the attribute, e.g. `ng-on-drop=\"onDrop()\"` executes the 'onDrop()' expression\n * when the `drop` event is fired.\n *\n * AngularJS provides specific directives for many events, such as {@link ngClick}, so in most\n * cases it is not necessary to use `ngOn`. However, AngularJS does not support all events\n * (e.g. the `drop` event in the example above), and new events might be introduced in later DOM\n * standards.\n *\n * Another use-case for `ngOn` is listening to\n * [custom events](https://developer.mozilla.org/docs/Web/Guide/Events/Creating_and_triggering_events)\n * fired by\n * [custom elements](https://developer.mozilla.org/docs/Web/Web_Components/Using_custom_elements).\n *\n * ## Binding to camelCase properties\n *\n * Since HTML attributes are case-insensitive, camelCase properties like `myEvent` must be escaped.\n * AngularJS uses the underscore (_) in front of a character to indicate that it is uppercase, so\n * `myEvent` must be written as `ng-on-my_event=\"expression\"`.\n *\n * @example\n * ### Bind to built-in DOM events\n *\n * \n * \n * angular.module('exampleNgOn', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function() {\n * this.clickCount = 0;\n * this.mouseoverCount = 0;\n *\n * this.loadingState = 0;\n * }\n * });\n * \n * \n *
\n * This is equivalent to `ngClick` and `ngMouseover`:
\n * Click or mouseover
\n * clickCount: {{$ctrl.clickCount}}
\n * mouseover: {{$ctrl.mouseoverCount}}\n *\n *
\n *\n * For the `error` and `load` event on images no built-in AngularJS directives exist:
\n *
\n *
\n * Image is loading\n * Image load error\n * Image loaded successfully\n *
\n *
\n *
\n * \n *
\n *
\n *
\n *\n *\n * @example\n * ### Bind to custom DOM events\n *\n * \n * \n * angular.module('exampleNgOn', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function() {\n * this.eventLog = '';\n *\n * this.listener = function($event) {\n * this.eventLog = 'Event with type \"' + $event.type + '\" fired at ' + $event.detail;\n * };\n * }\n * })\n * .component('childComponent', {\n * templateUrl: 'child.html',\n * controller: function($element) {\n * this.fireEvent = function() {\n * var event = new CustomEvent('customtype', { detail: new Date()});\n *\n * $element[0].dispatchEvent(event);\n * };\n * }\n * });\n * \n * \n *
\n * Event log: {{$ctrl.eventLog}}\n *
\n * \n \n * \n * \n *
\n *
\n *
\n */\n\n var $compileMinErr = minErr('$compile');\n function UNINITIALIZED_VALUE() {}\n var _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();\n\n /**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n $CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\n /** @this */\n function $CompileProvider($provide, $$sanitizeUriProvider) {\n var hasDirectives = {},\n Suffix = 'Directive',\n COMMENT_DIRECTIVE_REGEXP = /^\\s*directive:\\s*([\\w-]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\w-]+)(?::([^;]+))?;?)/,\n ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n // The assumption is that future DOM event attribute names will begin with\n // 'on' and be composed of only English letters.\n var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n var bindingCache = createMap();\n function parseIsolateBindings(scope, directiveName, isController) {\n var LOCAL_REGEXP = /^([@&]|[=<](\\*?))(\\??)\\s*([\\w$]*)$/;\n var bindings = createMap();\n forEach(scope, function (definition, scopeName) {\n definition = definition.trim();\n if (definition in bindingCache) {\n bindings[scopeName] = bindingCache[definition];\n return;\n }\n var match = definition.match(LOCAL_REGEXP);\n if (!match) {\n throw $compileMinErr('iscp', 'Invalid {3} for directive \\'{0}\\'.' + ' Definition: {... {1}: \\'{2}\\' ...}', directiveName, scopeName, definition, isController ? 'controller bindings definition' : 'isolate scope definition');\n }\n bindings[scopeName] = {\n mode: match[1][0],\n collection: match[2] === '*',\n optional: match[3] === '?',\n attrName: match[4] || scopeName\n };\n if (match[4]) {\n bindingCache[definition] = bindings[scopeName];\n }\n });\n return bindings;\n }\n function parseDirectiveBindings(directive, directiveName) {\n var bindings = {\n isolateScope: null,\n bindToController: null\n };\n if (isObject(directive.scope)) {\n if (directive.bindToController === true) {\n bindings.bindToController = parseIsolateBindings(directive.scope, directiveName, true);\n bindings.isolateScope = {};\n } else {\n bindings.isolateScope = parseIsolateBindings(directive.scope, directiveName, false);\n }\n }\n if (isObject(directive.bindToController)) {\n bindings.bindToController = parseIsolateBindings(directive.bindToController, directiveName, true);\n }\n if (bindings.bindToController && !directive.controller) {\n // There is no controller\n throw $compileMinErr('noctrl', 'Cannot bind to controller without directive \\'{0}\\'s controller.', directiveName);\n }\n return bindings;\n }\n function assertValidDirectiveName(name) {\n var letter = name.charAt(0);\n if (!letter || letter !== lowercase(letter)) {\n throw $compileMinErr('baddir', 'Directive/Component name \\'{0}\\' is invalid. The first character must be a lowercase letter', name);\n }\n if (name !== name.trim()) {\n throw $compileMinErr('baddir', 'Directive/Component name \\'{0}\\' is invalid. The name should not contain leading or trailing whitespaces', name);\n }\n }\n function getDirectiveRequire(directive) {\n var require = directive.require || directive.controller && directive.name;\n if (!isArray(require) && isObject(require)) {\n forEach(require, function (value, key) {\n var match = value.match(REQUIRE_PREFIX_REGEXP);\n var name = value.substring(match[0].length);\n if (!name) require[key] = match[0] + key;\n });\n }\n return require;\n }\n function getDirectiveRestrict(restrict, name) {\n if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) {\n throw $compileMinErr('badrestrict', 'Restrict property \\'{0}\\' of directive \\'{1}\\' is invalid', restrict, name);\n }\n return restrict || 'EA';\n }\n\n /**\n * @ngdoc method\n * @name $compileProvider#directive\n * @kind function\n *\n * @description\n * Register a new directive with the compiler.\n *\n * @param {string|Object} name Name of the directive in camel-case (i.e. `ngBind` which will match\n * as `ng-bind`), or an object map of directives where the keys are the names and the values\n * are the factories.\n * @param {Function|Array} directiveFactory An injectable directive factory function. See the\n * {@link guide/directive directive guide} and the {@link $compile compile API} for more info.\n * @returns {ng.$compileProvider} Self for chaining.\n */\n this.directive = function registerDirective(name, directiveFactory) {\n assertArg(name, 'name');\n assertNotHasOwnProperty(name, 'directive');\n if (isString(name)) {\n assertValidDirectiveName(name);\n assertArg(directiveFactory, 'directiveFactory');\n if (!hasDirectives.hasOwnProperty(name)) {\n hasDirectives[name] = [];\n $provide.factory(name + Suffix, ['$injector', '$exceptionHandler', function ($injector, $exceptionHandler) {\n var directives = [];\n forEach(hasDirectives[name], function (directiveFactory, index) {\n try {\n var directive = $injector.invoke(directiveFactory);\n if (isFunction(directive)) {\n directive = {\n compile: valueFn(directive)\n };\n } else if (!directive.compile && directive.link) {\n directive.compile = valueFn(directive.link);\n }\n directive.priority = directive.priority || 0;\n directive.index = index;\n directive.name = directive.name || name;\n directive.require = getDirectiveRequire(directive);\n directive.restrict = getDirectiveRestrict(directive.restrict, name);\n directive.$$moduleName = directiveFactory.$$moduleName;\n directives.push(directive);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n return directives;\n }]);\n }\n hasDirectives[name].push(directiveFactory);\n } else {\n forEach(name, reverseParams(registerDirective));\n }\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#component\n * @module ng\n * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match ``),\n * or an object map of components where the keys are the names and the values are the component definition objects.\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object}),\n * with the following properties (all optional):\n *\n * - `controller` – `{(string|function()=}` – controller constructor function that should be\n * associated with newly created scope or the name of a {@link ng.$compile#-controller-\n * registered controller} if passed as a string. An empty `noop` function by default.\n * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * If not present, this will default to be `$ctrl`.\n * - `template` – `{string=|function()=}` – html template as a string or a function that\n * returns an html template as a string which should be used as the contents of this component.\n * Empty string by default.\n *\n * If `template` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html\n * template that should be used as the contents of this component.\n *\n * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.\n * Component properties are always bound to the component controller and not to the scope.\n * See {@link ng.$compile#-bindtocontroller- `bindToController`}.\n * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.\n * Disabled by default.\n * - `require` - `{Object=}` - requires the controllers of other directives and binds them to\n * this component's controller. The object keys specify the property names under which the required\n * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}.\n * - `$...` – additional properties to attach to the directive factory function and the controller\n * constructor function. (This is used by the component router to annotate)\n *\n * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.\n * @description\n * Register a **component definition** with the compiler. This is a shorthand for registering a special\n * type of directive, which represents a self-contained UI component in your application. Such components\n * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).\n *\n * Component definitions are very simple and do not require as much configuration as defining general\n * directives. Component definitions usually consist only of a template and a controller backing it.\n *\n * In order to make the definition easier, components enforce best practices like use of `controllerAs`,\n * `bindToController`. They always have **isolate scope** and are restricted to elements.\n *\n * Here are a few examples of how you would usually define components:\n *\n * ```js\n * var myMod = angular.module(...);\n * myMod.component('myComp', {\n * template: '
My name is {{$ctrl.name}}
',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '
My name is {{$ctrl.name}}
',\n * bindings: {name: '@'}\n * });\n *\n * myMod.component('myComp', {\n * templateUrl: 'views/my-comp.html',\n * controller: 'MyCtrl',\n * controllerAs: 'ctrl',\n * bindings: {name: '@'}\n * });\n *\n * ```\n * For more examples, and an in-depth guide, see the {@link guide/component component guide}.\n *\n *
\n * See also {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n this.component = function registerComponent(name, options) {\n if (!isString(name)) {\n forEach(name, reverseParams(bind(this, registerComponent)));\n return this;\n }\n var controller = options.controller || function () {};\n function factory($injector) {\n function makeInjectable(fn) {\n if (isFunction(fn) || isArray(fn)) {\n return /** @this */function (tElement, tAttrs) {\n return $injector.invoke(fn, this, {\n $element: tElement,\n $attrs: tAttrs\n });\n };\n } else {\n return fn;\n }\n }\n var template = !options.template && !options.templateUrl ? '' : options.template;\n var ddo = {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n\n // Copy annotations (starting with $) over to the DDO\n forEach(options, function (val, key) {\n if (key.charAt(0) === '$') ddo[key] = val;\n });\n return ddo;\n }\n\n // TODO(pete) remove the following `forEach` before we release 1.6.0\n // The component-router@0.2.0 looks for the annotations on the controller constructor\n // Nothing in AngularJS looks for annotations on the factory function but we can't remove\n // it from 1.5.x yet.\n\n // Copy any annotation properties (starting with $) over to the factory and controller constructor functions\n // These could be used by libraries such as the new component router\n forEach(options, function (val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n // Don't try to copy over annotations to named controller\n if (isFunction(controller)) controller[key] = val;\n }\n });\n factory.$inject = ['$injector'];\n return this.directive(name, factory);\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationTrustedUrlList\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationTrustedUrlList`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationTrustedUrlList = function (regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.aHrefSanitizationTrustedUrlList(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationTrustedUrlList();\n }\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $compileProvider#aHrefSanitizationTrustedUrlList\n * aHrefSanitizationTrustedUrlList} instead.\n */\n Object.defineProperty(this, 'aHrefSanitizationWhitelist', {\n get: function () {\n return this.aHrefSanitizationTrustedUrlList;\n },\n set: function (value) {\n this.aHrefSanitizationTrustedUrlList = value;\n }\n });\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationTrustedUrlList\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationTrustedUrlList`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationTrustedUrlList = function (regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList();\n }\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $compileProvider#imgSrcSanitizationTrustedUrlList\n * imgSrcSanitizationTrustedUrlList} instead.\n */\n Object.defineProperty(this, 'imgSrcSanitizationWhitelist', {\n get: function () {\n return this.imgSrcSanitizationTrustedUrlList;\n },\n set: function (value) {\n this.imgSrcSanitizationTrustedUrlList = value;\n }\n });\n\n /**\n * @ngdoc method\n * @name $compileProvider#debugInfoEnabled\n *\n * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n * current debugInfoEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable various debug runtime information in the compiler such as adding\n * binding information and a reference to the current scope on to DOM elements.\n * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n * * `ng-binding` CSS class\n * * `ng-scope` and `ng-isolated-scope` CSS classes\n * * `$binding` data property containing an array of the binding expressions\n * * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return\n * the element's scope.\n * * Placeholder comments will contain information about what directive and binding caused the placeholder.\n * E.g. ``.\n *\n * You may want to disable this in production for a significant performance boost. See\n * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n *\n * The default value is true.\n */\n var debugInfoEnabled = true;\n this.debugInfoEnabled = function (enabled) {\n if (isDefined(enabled)) {\n debugInfoEnabled = enabled;\n return this;\n }\n return debugInfoEnabled;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#strictComponentBindingsEnabled\n *\n * @param {boolean=} enabled update the strictComponentBindingsEnabled state if provided,\n * otherwise return the current strictComponentBindingsEnabled state.\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable / disable the strict component bindings check. If enabled, the\n * compiler will enforce that all scope / controller bindings of a\n * {@link $compileProvider#directive directive} / {@link $compileProvider#component component}\n * that are not set as optional with `?`, must be provided when the directive is instantiated.\n * If not provided, the compiler will throw the\n * {@link error/$compile/missingattr $compile:missingattr error}.\n *\n * The default value is false.\n */\n var strictComponentBindingsEnabled = false;\n this.strictComponentBindingsEnabled = function (enabled) {\n if (isDefined(enabled)) {\n strictComponentBindingsEnabled = enabled;\n return this;\n }\n return strictComponentBindingsEnabled;\n };\n var TTL = 10;\n /**\n * @ngdoc method\n * @name $compileProvider#onChangesTtl\n * @description\n *\n * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result\n * in several iterations of calls to these hooks. However if an application needs more than the default 10\n * iterations to stabilize then you should investigate what is causing the model to continuously change during\n * the `$onChanges` hook execution.\n *\n * Increasing the TTL could have performance implications, so you should not change it without proper justification.\n *\n * @param {number} limit The number of `$onChanges` hook iterations.\n * @returns {number|object} the current limit (or `this` if called as a setter for chaining)\n */\n this.onChangesTtl = function (value) {\n if (arguments.length) {\n TTL = value;\n return this;\n }\n return TTL;\n };\n var commentDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#commentDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on comments should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on comments for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check comments when looking for directives.\n * This should however only be used if you are sure that no comment directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on comments\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.commentDirectivesEnabled = function (value) {\n if (arguments.length) {\n commentDirectivesEnabledConfig = value;\n return this;\n }\n return commentDirectivesEnabledConfig;\n };\n var cssClassDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#cssClassDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on element classes should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on element classes for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check element classes when looking for directives.\n * This should however only be used if you are sure that no class directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on element classes\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.cssClassDirectivesEnabled = function (value) {\n if (arguments.length) {\n cssClassDirectivesEnabledConfig = value;\n return this;\n }\n return cssClassDirectivesEnabledConfig;\n };\n\n /**\n * The security context of DOM Properties.\n * @private\n */\n var PROP_CONTEXTS = createMap();\n\n /**\n * @ngdoc method\n * @name $compileProvider#addPropertySecurityContext\n * @description\n *\n * Defines the security context for DOM properties bound by ng-prop-*.\n *\n * @param {string} elementName The element name or '*' to match any element.\n * @param {string} propertyName The DOM property name.\n * @param {string} ctx The {@link $sce} security context in which this value is safe for use, e.g. `$sce.URL`\n * @returns {object} `this` for chaining\n */\n this.addPropertySecurityContext = function (elementName, propertyName, ctx) {\n var key = elementName.toLowerCase() + '|' + propertyName.toLowerCase();\n if (key in PROP_CONTEXTS && PROP_CONTEXTS[key] !== ctx) {\n throw $compileMinErr('ctxoverride', 'Property context \\'{0}.{1}\\' already set to \\'{2}\\', cannot override to \\'{3}\\'.', elementName, propertyName, PROP_CONTEXTS[key], ctx);\n }\n PROP_CONTEXTS[key] = ctx;\n return this;\n };\n\n /* Default property contexts.\n *\n * Copy of https://github.com/angular/angular/blob/6.0.6/packages/compiler/src/schema/dom_security_schema.ts#L31-L58\n * Changing:\n * - SecurityContext.* => SCE_CONTEXTS/$sce.*\n * - STYLE => CSS\n * - various URL => MEDIA_URL\n * - *|formAction, form|action URL => RESOURCE_URL (like the attribute)\n */\n (function registerNativePropertyContexts() {\n function registerContext(ctx, values) {\n forEach(values, function (v) {\n PROP_CONTEXTS[v.toLowerCase()] = ctx;\n });\n }\n registerContext(SCE_CONTEXTS.HTML, ['iframe|srcdoc', '*|innerHTML', '*|outerHTML']);\n registerContext(SCE_CONTEXTS.CSS, ['*|style']);\n registerContext(SCE_CONTEXTS.URL, ['area|href', 'area|ping', 'a|href', 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'input|src', 'ins|cite', 'q|cite']);\n registerContext(SCE_CONTEXTS.MEDIA_URL, ['audio|src', 'img|src', 'img|srcset', 'source|src', 'source|srcset', 'track|src', 'video|src', 'video|poster']);\n registerContext(SCE_CONTEXTS.RESOURCE_URL, ['*|formAction', 'applet|code', 'applet|codebase', 'base|href', 'embed|src', 'frame|src', 'form|action', 'head|profile', 'html|manifest', 'iframe|src', 'link|href', 'media|src', 'object|codebase', 'object|data', 'script|src']);\n })();\n this.$get = ['$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse', '$controller', '$rootScope', '$sce', '$animate', function ($injector, $interpolate, $exceptionHandler, $templateRequest, $parse, $controller, $rootScope, $sce, $animate) {\n var SIMPLE_ATTR_NAME = /^\\w/;\n var specialAttrHolder = window.document.createElement('div');\n var commentDirectivesEnabled = commentDirectivesEnabledConfig;\n var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig;\n var onChangesTtl = TTL;\n // The onChanges hooks should all be run together in a single digest\n // When changes occur, the call to trigger their hooks will be added to this queue\n var onChangesQueue;\n\n // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest\n function flushOnChangesQueue() {\n try {\n if (! --onChangesTtl) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function () {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }\n function sanitizeSrcset(value, invokeType) {\n if (!value) {\n return value;\n }\n if (!isString(value)) {\n throw $compileMinErr('srcset', 'Can\\'t pass trusted values to `{0}`: \"{1}\"', invokeType, value.toString());\n }\n\n // Such values are a bit too complex to handle automatically inside $sce.\n // Instead, we sanitize each of the URIs individually, which works, even dynamically.\n\n // It's not possible to work around this using `$sce.trustAsMediaUrl`.\n // If you want to programmatically set explicitly trusted unsafe URLs, you should use\n // `$sce.trustAsHtml` on the whole `img` tag and inject it into the DOM using the\n // `ng-bind-html` directive.\n\n var result = '';\n\n // first check if there are spaces because it's not the same pattern\n var trimmedSrcset = trim(value);\n // ( 999x ,| 999w ,| ,|, )\n var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n // split srcset into tuple of uri and descriptor except for the last item\n var rawUris = trimmedSrcset.split(pattern);\n\n // for each tuples\n var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n for (var i = 0; i < nbrUrisWith2parts; i++) {\n var innerIdx = i * 2;\n // sanitize the uri\n result += $sce.getTrustedMediaUrl(trim(rawUris[innerIdx]));\n // add the descriptor\n result += ' ' + trim(rawUris[innerIdx + 1]);\n }\n\n // split the last item into uri and descriptor\n var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n // sanitize the last uri\n result += $sce.getTrustedMediaUrl(trim(lastTuple[0]));\n\n // and add the last descriptor if any\n if (lastTuple.length === 2) {\n result += ' ' + trim(lastTuple[1]);\n }\n return result;\n }\n function Attributes(element, attributesToCopy) {\n if (attributesToCopy) {\n var keys = Object.keys(attributesToCopy);\n var i, l, key;\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n this[key] = attributesToCopy[key];\n }\n } else {\n this.$attr = {};\n }\n this.$$element = element;\n }\n Attributes.prototype = {\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$normalize\n * @kind function\n *\n * @description\n * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n * `data-`) to its normalized, camelCase form.\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * @param {string} name Name to normalize\n */\n $normalize: directiveNormalize,\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$addClass\n * @kind function\n *\n * @description\n * Adds the CSS class value specified by the classVal parameter to the element. If animations\n * are enabled then an animation will be triggered for the class addition.\n *\n * @param {string} classVal The className value that will be added to the element\n */\n $addClass: function (classVal) {\n if (classVal && classVal.length > 0) {\n $animate.addClass(this.$$element, classVal);\n }\n },\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$removeClass\n * @kind function\n *\n * @description\n * Removes the CSS class value specified by the classVal parameter from the element. If\n * animations are enabled then an animation will be triggered for the class removal.\n *\n * @param {string} classVal The className value that will be removed from the element\n */\n $removeClass: function (classVal) {\n if (classVal && classVal.length > 0) {\n $animate.removeClass(this.$$element, classVal);\n }\n },\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$updateClass\n * @kind function\n *\n * @description\n * Adds and removes the appropriate CSS class values to the element based on the difference\n * between the new and old CSS class values (specified as newClasses and oldClasses).\n *\n * @param {string} newClasses The current CSS className value\n * @param {string} oldClasses The former CSS className value\n */\n $updateClass: function (newClasses, oldClasses) {\n var toAdd = tokenDifference(newClasses, oldClasses);\n if (toAdd && toAdd.length) {\n $animate.addClass(this.$$element, toAdd);\n }\n var toRemove = tokenDifference(oldClasses, newClasses);\n if (toRemove && toRemove.length) {\n $animate.removeClass(this.$$element, toRemove);\n }\n },\n /**\n * Set a normalized attribute on the element in a way such that all directives\n * can share the attribute. This function properly handles boolean attributes.\n * @param {string} key Normalized key. (ie ngAttribute)\n * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n * Defaults to true.\n * @param {string=} attrName Optional none normalized name. Defaults to key.\n */\n $set: function (key, value, writeAttr, attrName) {\n // TODO: decide whether or not to throw an error if \"class\"\n // is set through this function since it may cause $updateClass to\n // become unstable.\n\n var node = this.$$element[0],\n booleanKey = getBooleanAttrName(node, key),\n aliasedKey = getAliasedAttrName(key),\n observer = key,\n nodeName;\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\n } else if (aliasedKey) {\n this[aliasedKey] = value;\n observer = aliasedKey;\n }\n this[key] = value;\n\n // translate normalized key to actual key\n if (attrName) {\n this.$attr[key] = attrName;\n } else {\n attrName = this.$attr[key];\n if (!attrName) {\n this.$attr[key] = attrName = snake_case(key, '-');\n }\n }\n nodeName = nodeName_(this.$$element);\n\n // Sanitize img[srcset] values.\n if (nodeName === 'img' && key === 'srcset') {\n this[key] = value = sanitizeSrcset(value, '$set(\\'srcset\\', value)');\n }\n if (writeAttr !== false) {\n if (value === null || isUndefined(value)) {\n this.$$element.removeAttr(attrName);\n } else {\n if (SIMPLE_ATTR_NAME.test(attrName)) {\n // jQuery skips special boolean attrs treatment in XML nodes for\n // historical reasons and hence AngularJS cannot freely call\n // `.attr(attrName, false) with such attributes. To avoid issues\n // in XHTML, call `removeAttr` in such cases instead.\n // See https://github.com/jquery/jquery/issues/4249\n if (booleanKey && value === false) {\n this.$$element.removeAttr(attrName);\n } else {\n this.$$element.attr(attrName, value);\n }\n } else {\n setSpecialAttr(this.$$element[0], attrName, value);\n }\n }\n }\n\n // fire observers\n var $$observers = this.$$observers;\n if ($$observers) {\n forEach($$observers[observer], function (fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n }\n },\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$observe\n * @kind function\n *\n * @description\n * Observes an interpolated attribute.\n *\n * The observer function will be invoked once during the next `$digest` following\n * compilation. The observer is then invoked whenever the interpolated value\n * changes.\n *\n * @param {string} key Normalized key. (ie ngAttribute) .\n * @param {function(interpolatedValue)} fn Function that will be called whenever\n the interpolated value of the attribute changes.\n * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation\n * guide} for more info.\n * @returns {function()} Returns a deregistration function for this observer.\n */\n $observe: function (key, fn) {\n var attrs = this,\n $$observers = attrs.$$observers || (attrs.$$observers = createMap()),\n listeners = $$observers[key] || ($$observers[key] = []);\n listeners.push(fn);\n $rootScope.$evalAsync(function () {\n if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n return function () {\n arrayRemove(listeners, fn);\n };\n }\n };\n function setSpecialAttr(element, attrName, value) {\n // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`\n // so we have to jump through some hoops to get such an attribute\n // https://github.com/angular/angular.js/pull/13318\n specialAttrHolder.innerHTML = '';\n var attributes = specialAttrHolder.firstChild.attributes;\n var attribute = attributes[0];\n // We have to remove the attribute from its container element before we can add it to the destination element\n attributes.removeNamedItem(attribute.name);\n attribute.value = value;\n element.attributes.setNamedItem(attribute);\n }\n function safeAddClass($element, className) {\n try {\n $element.addClass(className);\n } catch (e) {\n // ignore, since it means that we are trying to set class on\n // SVG element, where class name is read-only.\n }\n }\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n denormalizeTemplate = startSymbol === '{{' && endSymbol === '}}' ? identity : function denormalizeTemplate(template) {\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n },\n NG_PREFIX_BINDING = /^ng(Attr|Prop|On)([A-Z].*)$/;\n var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;\n compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n var bindings = $element.data('$binding') || [];\n if (isArray(binding)) {\n bindings = bindings.concat(binding);\n } else {\n bindings.push(binding);\n }\n $element.data('$binding', bindings);\n } : noop;\n compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n safeAddClass($element, 'ng-binding');\n } : noop;\n compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n var dataName = isolated ? noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope' : '$scope';\n $element.data(dataName, scope);\n } : noop;\n compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n } : noop;\n compile.$$createComment = function (directiveName, comment) {\n var content = '';\n if (debugInfoEnabled) {\n content = ' ' + (directiveName || '') + ': ';\n if (comment) content += comment + ' ';\n }\n return window.document.createComment(content);\n };\n return compile;\n\n //================================\n\n function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n if (!($compileNodes instanceof jqLite)) {\n // jquery always rewraps, whereas we need to preserve the original selector so that we can\n // modify it.\n $compileNodes = jqLite($compileNodes);\n }\n var compositeLinkFn = compileNodes($compileNodes, transcludeFn, $compileNodes, maxPriority, ignoreDirective, previousCompileContext);\n compile.$$addScopeClass($compileNodes);\n var namespace = null;\n return function publicLinkFn(scope, cloneConnectFn, options) {\n if (!$compileNodes) {\n throw $compileMinErr('multilink', 'This element has already been linked.');\n }\n assertArg(scope, 'scope');\n if (previousCompileContext && previousCompileContext.needsNewScope) {\n // A parent directive did a replace and a directive on this element asked\n // for transclusion, which caused us to lose a layer of element on which\n // we could hold the new transclusion scope, so we will create it manually\n // here.\n scope = scope.$parent.$new();\n }\n options = options || {};\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n transcludeControllers = options.transcludeControllers,\n futureParentElement = options.futureParentElement;\n\n // When `parentBoundTranscludeFn` is passed, it is a\n // `controllersBoundTransclude` function (it was previously passed\n // as `transclude` to directive.link) so we must unwrap it to get\n // its `boundTranscludeFn`\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n }\n if (!namespace) {\n namespace = detectNamespaceForChildElements(futureParentElement);\n }\n var $linkNode;\n if (namespace !== 'html') {\n // When using a directive with replace:true and templateUrl the $compileNodes\n // (or a child element inside of them)\n // might change, so we need to recreate the namespace adapted compileNodes\n // for call to the link function.\n // Note: This will already clone the nodes...\n $linkNode = jqLite(wrapTemplate(namespace, jqLite('
').append($compileNodes).html()));\n } else if (cloneConnectFn) {\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n // and sometimes changes the structure of the DOM.\n $linkNode = JQLitePrototype.clone.call($compileNodes);\n } else {\n $linkNode = $compileNodes;\n }\n if (transcludeControllers) {\n for (var controllerName in transcludeControllers) {\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n }\n }\n compile.$$addScopeInfo($linkNode, scope);\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n if (!cloneConnectFn) {\n $compileNodes = compositeLinkFn = null;\n }\n return $linkNode;\n };\n }\n function detectNamespaceForChildElements(parentElement) {\n // TODO: Make this detect MathML as well...\n var node = parentElement && parentElement[0];\n if (!node) {\n return 'html';\n } else {\n return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';\n }\n }\n\n /**\n * Compile function matches each node in nodeList against the directives. Once all directives\n * for a particular node are collected their compile functions are executed. The compile\n * functions return values - the linking functions - are combined into a composite linking\n * function, which is the a linking function for the node.\n *\n * @param {NodeList} nodeList an array of nodes or NodeList to compile\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new child of the transcluded parent scope.\n * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n * the rootElement must be set the jqLite collection of the compile root. This is\n * needed so that the jqLite collection items can be replaced with widgets.\n * @param {number=} maxPriority Max directive priority.\n * @returns {Function} A composite linking function of all of the matched directives or null.\n */\n function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective, previousCompileContext) {\n var linkFns = [],\n // `nodeList` can be either an element's `.childNodes` (live NodeList)\n // or a jqLite/jQuery collection or an array\n notLiveList = isArray(nodeList) || nodeList instanceof jqLite,\n attrs,\n directives,\n nodeLinkFn,\n childNodes,\n childLinkFn,\n linkFnFound,\n nodeLinkFnFound;\n for (var i = 0; i < nodeList.length; i++) {\n attrs = new Attributes();\n\n // Support: IE 11 only\n // Workaround for #11781 and #14924\n if (msie === 11) {\n mergeConsecutiveTextNodes(nodeList, i, notLiveList);\n }\n\n // We must always refer to `nodeList[i]` hereafter,\n // since the nodes can be replaced underneath us.\n directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined, ignoreDirective);\n nodeLinkFn = directives.length ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement, null, [], [], previousCompileContext) : null;\n if (nodeLinkFn && nodeLinkFn.scope) {\n compile.$$addScopeClass(attrs.$$element);\n }\n childLinkFn = nodeLinkFn && nodeLinkFn.terminal || !(childNodes = nodeList[i].childNodes) || !childNodes.length ? null : compileNodes(childNodes, nodeLinkFn ? (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement) && nodeLinkFn.transclude : transcludeFn);\n if (nodeLinkFn || childLinkFn) {\n linkFns.push(i, nodeLinkFn, childLinkFn);\n linkFnFound = true;\n nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n }\n\n //use the previous context only for the first element in the virtual group\n previousCompileContext = null;\n }\n\n // return a linking function if we have found anything, null otherwise\n return linkFnFound ? compositeLinkFn : null;\n function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n var stableNodeList;\n if (nodeLinkFnFound) {\n // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n // offsets don't get screwed up\n var nodeListLength = nodeList.length;\n stableNodeList = new Array(nodeListLength);\n\n // create a sparse array by only copying the elements which have a linkFn\n for (i = 0; i < linkFns.length; i += 3) {\n idx = linkFns[i];\n stableNodeList[idx] = nodeList[idx];\n }\n } else {\n stableNodeList = nodeList;\n }\n for (i = 0, ii = linkFns.length; i < ii;) {\n node = stableNodeList[linkFns[i++]];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n compile.$$addScopeInfo(jqLite(node), childScope);\n } else {\n childScope = scope;\n }\n if (nodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, nodeLinkFn.transclude, parentBoundTranscludeFn);\n } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n childBoundTranscludeFn = parentBoundTranscludeFn;\n } else if (!parentBoundTranscludeFn && transcludeFn) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n } else {\n childBoundTranscludeFn = null;\n }\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n }\n }\n }\n }\n function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) {\n var node = nodeList[idx];\n var parent = node.parentNode;\n var sibling;\n if (node.nodeType !== NODE_TYPE_TEXT) {\n return;\n }\n while (true) {\n sibling = parent ? node.nextSibling : nodeList[idx + 1];\n if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) {\n break;\n }\n node.nodeValue = node.nodeValue + sibling.nodeValue;\n if (sibling.parentNode) {\n sibling.parentNode.removeChild(sibling);\n }\n if (notLiveList && sibling === nodeList[idx + 1]) {\n nodeList.splice(idx + 1, 1);\n }\n }\n }\n function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {\n function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n if (!transcludedScope) {\n transcludedScope = scope.$new(false, containingScope);\n transcludedScope.$$transcluded = true;\n }\n return transcludeFn(transcludedScope, cloneFn, {\n parentBoundTranscludeFn: previousBoundTranscludeFn,\n transcludeControllers: controllers,\n futureParentElement: futureParentElement\n });\n }\n\n // We need to attach the transclusion slots onto the `boundTranscludeFn`\n // so that they are available inside the `controllersBoundTransclude` function\n var boundSlots = boundTranscludeFn.$$slots = createMap();\n for (var slotName in transcludeFn.$$slots) {\n if (transcludeFn.$$slots[slotName]) {\n boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);\n } else {\n boundSlots[slotName] = null;\n }\n }\n return boundTranscludeFn;\n }\n\n /**\n * Looks for directives on the given node and adds them to the directive collection which is\n * sorted.\n *\n * @param node Node to search.\n * @param directives An array to which the directives are added to. This array is sorted before\n * the function returns.\n * @param attrs The shared attrs object which is used to populate the normalized attributes.\n * @param {number=} maxPriority Max directive priority.\n */\n function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n var nodeType = node.nodeType,\n attrsMap = attrs.$attr,\n match,\n nodeName,\n className;\n switch (nodeType) {\n case NODE_TYPE_ELEMENT:\n /* Element */\n\n nodeName = nodeName_(node);\n\n // use the node name: \n addDirective(directives, directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, value, ngPrefixMatch, nAttrs = node.attributes, j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n var attrStartName = false;\n var attrEndName = false;\n var isNgAttr = false,\n isNgProp = false,\n isNgEvent = false;\n var multiElementMatch;\n attr = nAttrs[j];\n name = attr.name;\n value = attr.value;\n nName = directiveNormalize(name.toLowerCase());\n\n // Support ng-attr-*, ng-prop-* and ng-on-*\n if (ngPrefixMatch = nName.match(NG_PREFIX_BINDING)) {\n isNgAttr = ngPrefixMatch[1] === 'Attr';\n isNgProp = ngPrefixMatch[1] === 'Prop';\n isNgEvent = ngPrefixMatch[1] === 'On';\n\n // Normalize the non-prefixed name\n name = name.replace(PREFIX_REGEXP, '').toLowerCase().substr(4 + ngPrefixMatch[1].length).replace(/_(.)/g, function (match, letter) {\n return letter.toUpperCase();\n });\n\n // Support *-start / *-end multi element directives\n } else if ((multiElementMatch = nName.match(MULTI_ELEMENT_DIR_RE)) && directiveIsMultiElement(multiElementMatch[1])) {\n attrStartName = name;\n attrEndName = name.substr(0, name.length - 5) + 'end';\n name = name.substr(0, name.length - 6);\n }\n if (isNgProp || isNgEvent) {\n attrs[nName] = value;\n attrsMap[nName] = attr.name;\n if (isNgProp) {\n addPropertyDirective(node, directives, nName, name);\n } else {\n addEventDirective(directives, nName, name);\n }\n } else {\n // Update nName for cases where a prefix was removed\n // NOTE: the .toLowerCase() is unnecessary and causes https://github.com/angular/angular.js/issues/16624 for ng-attr-*\n nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n attrs[nName] = value;\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n }\n addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName, attrEndName);\n }\n }\n if (nodeName === 'input' && node.getAttribute('type') === 'hidden') {\n // Hidden input elements can have strange behaviour when navigating back to the page\n // This tells the browser not to try to cache and reinstate previous values\n node.setAttribute('autocomplete', 'off');\n }\n\n // use class as directive\n if (!cssClassDirectivesEnabled) break;\n className = node.className;\n if (isObject(className)) {\n // Maybe SVGAnimatedString\n className = className.animVal;\n }\n if (isString(className) && className !== '') {\n while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {\n nName = directiveNormalize(match[2]);\n if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[3]);\n }\n className = className.substr(match.index + match[0].length);\n }\n }\n break;\n case NODE_TYPE_TEXT:\n /* Text Node */\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case NODE_TYPE_COMMENT:\n /* Comment */\n if (!commentDirectivesEnabled) break;\n collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective);\n break;\n }\n directives.sort(byPriority);\n return directives;\n }\n function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n // function created because of performance, try/catch disables\n // the optimization of the whole function #14848\n try {\n var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n if (match) {\n var nName = directiveNormalize(match[1]);\n if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[2]);\n }\n }\n } catch (e) {\n // turns out that under some circumstances IE9 throws errors when one attempts to read\n // comment's node value.\n // Just ignore it and continue. (Can't seem to reproduce in test case.)\n }\n }\n\n /**\n * Given a node with a directive-start it collects all of the siblings until it finds\n * directive-end.\n * @param node\n * @param attrStart\n * @param attrEnd\n * @returns {*}\n */\n function groupScan(node, attrStart, attrEnd) {\n var nodes = [];\n var depth = 0;\n if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n do {\n if (!node) {\n throw $compileMinErr('uterdir', 'Unterminated attribute, found \\'{0}\\' but no matching \\'{1}\\' found.', attrStart, attrEnd);\n }\n if (node.nodeType === NODE_TYPE_ELEMENT) {\n if (node.hasAttribute(attrStart)) depth++;\n if (node.hasAttribute(attrEnd)) depth--;\n }\n nodes.push(node);\n node = node.nextSibling;\n } while (depth > 0);\n } else {\n nodes.push(node);\n }\n return jqLite(nodes);\n }\n\n /**\n * Wrapper for linking function which converts normal linking function into a grouped\n * linking function.\n * @param linkFn\n * @param attrStart\n * @param attrEnd\n * @returns {Function}\n */\n function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {\n element = groupScan(element[0], attrStart, attrEnd);\n return linkFn(scope, element, attrs, controllers, transcludeFn);\n };\n }\n\n /**\n * A function generator that is used to support both eager and lazy compilation\n * linking function.\n * @param eager\n * @param $compileNodes\n * @param transcludeFn\n * @param maxPriority\n * @param ignoreDirective\n * @param previousCompileContext\n * @returns {Function}\n */\n function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n var compiled;\n if (eager) {\n return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n }\n return /** @this */function lazyCompilation() {\n if (!compiled) {\n compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n\n // Null out all of these references in order to make them eligible for garbage collection\n // since this is a potentially long lived closure\n $compileNodes = transcludeFn = previousCompileContext = null;\n }\n return compiled.apply(this, arguments);\n };\n }\n\n /**\n * Once the directives have been collected, their compile functions are executed. This method\n * is responsible for inlining directive templates as well as terminating the application\n * of the directives if the terminal directive has been reached.\n *\n * @param {Array} directives Array of collected directives to execute their compile function.\n * this needs to be pre-sorted by priority order.\n * @param {Node} compileNode The raw DOM node to apply the compile functions to\n * @param {Object} templateAttrs The shared attribute function\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new\n * child of the transcluded parent scope.\n * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n * argument has the root jqLite array so that we can replace nodes\n * on it.\n * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n * compiling the transclusion.\n * @param {Array.} preLinkFns\n * @param {Array.} postLinkFns\n * @param {Object} previousCompileContext Context used for previous compilation of the current\n * node\n * @returns {Function} linkFn\n */\n function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn, jqCollection, originalReplaceDirective, preLinkFns, postLinkFns, previousCompileContext) {\n previousCompileContext = previousCompileContext || {};\n var terminalPriority = -Number.MAX_VALUE,\n newScopeDirective = previousCompileContext.newScopeDirective,\n controllerDirectives = previousCompileContext.controllerDirectives,\n newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasTemplate = false,\n hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n $compileNode = templateAttrs.$$element = jqLite(compileNode),\n directive,\n directiveName,\n $template,\n replaceDirective = originalReplaceDirective,\n childTranscludeFn = transcludeFn,\n linkFn,\n didScanForMultipleTransclusion = false,\n mightHaveMultipleTransclusionError = false,\n directiveValue;\n\n // executes all directives on the current element\n for (var i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n var attrStart = directive.$$start;\n var attrEnd = directive.$$end;\n\n // collect multiblock sections\n if (attrStart) {\n $compileNode = groupScan(compileNode, attrStart, attrEnd);\n }\n $template = undefined;\n if (terminalPriority > directive.priority) {\n break; // prevent further processing of directives\n }\n directiveValue = directive.scope;\n if (directiveValue) {\n // skip the check for directives with async templates, we'll check the derived sync\n // directive when the template arrives\n if (!directive.templateUrl) {\n if (isObject(directiveValue)) {\n // This directive is trying to add an isolated scope.\n // Check that there is no scope of any kind already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective, directive, $compileNode);\n newIsolateScopeDirective = directive;\n } else {\n // This directive is trying to add a child scope.\n // Check that there is no isolated scope already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive, $compileNode);\n }\n }\n newScopeDirective = newScopeDirective || directive;\n }\n directiveName = directive.name;\n\n // If we encounter a condition that can result in transclusion on the directive,\n // then scan ahead in the remaining directives for others that may cause a multiple\n // transclusion error to be thrown during the compilation process. If a matching directive\n // is found, then we know that when we encounter a transcluded directive, we need to eagerly\n // compile the `transclude` function rather than doing it lazily in order to throw\n // exceptions at the correct time\n if (!didScanForMultipleTransclusion && (directive.replace && (directive.templateUrl || directive.template) || directive.transclude && !directive.$$tlb)) {\n var candidateDirective;\n for (var scanningIndex = i + 1; candidateDirective = directives[scanningIndex++];) {\n if (candidateDirective.transclude && !candidateDirective.$$tlb || candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template)) {\n mightHaveMultipleTransclusionError = true;\n break;\n }\n }\n didScanForMultipleTransclusion = true;\n }\n if (!directive.templateUrl && directive.controller) {\n controllerDirectives = controllerDirectives || createMap();\n assertNoDuplicate('\\'' + directiveName + '\\' controller', controllerDirectives[directiveName], directive, $compileNode);\n controllerDirectives[directiveName] = directive;\n }\n directiveValue = directive.transclude;\n if (directiveValue) {\n hasTranscludeDirective = true;\n\n // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n // This option should only be used by directives that know how to safely handle element transclusion,\n // where the transcluded nodes are added or replaced after linking.\n if (!directive.$$tlb) {\n assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n nonTlbTranscludeDirective = directive;\n }\n if (directiveValue === 'element') {\n hasElementTranscludeDirective = true;\n terminalPriority = directive.priority;\n $template = $compileNode;\n $compileNode = templateAttrs.$$element = jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName]));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, sliceArgs($template), compileNode);\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority, replaceDirective && replaceDirective.name, {\n // Don't pass in:\n // - controllerDirectives - otherwise we'll create duplicates controllers\n // - newIsolateScopeDirective or templateDirective - combining templates with\n // element transclusion doesn't make sense.\n //\n // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n // on the same element more than once.\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n } else {\n var slots = createMap();\n if (!isObject(directiveValue)) {\n $template = jqLite(jqLiteClone(compileNode)).contents();\n } else {\n // We have transclusion slots,\n // collect them up, compile them and store their transclusion functions\n $template = window.document.createDocumentFragment();\n var slotMap = createMap();\n var filledSlots = createMap();\n\n // Parse the element selectors\n forEach(directiveValue, function (elementSelector, slotName) {\n // If an element selector starts with a ? then it is optional\n var optional = elementSelector.charAt(0) === '?';\n elementSelector = optional ? elementSelector.substring(1) : elementSelector;\n slotMap[elementSelector] = slotName;\n\n // We explicitly assign `null` since this implies that a slot was defined but not filled.\n // Later when calling boundTransclusion functions with a slot name we only error if the\n // slot is `undefined`\n slots[slotName] = null;\n\n // filledSlots contains `true` for all slots that are either optional or have been\n // filled. This is used to check that we have not missed any required slots\n filledSlots[slotName] = optional;\n });\n\n // Add the matching elements into their slot\n forEach($compileNode.contents(), function (node) {\n var slotName = slotMap[directiveNormalize(nodeName_(node))];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || window.document.createDocumentFragment();\n slots[slotName].appendChild(node);\n } else {\n $template.appendChild(node);\n }\n });\n\n // Check for required slots that were not filled\n forEach(filledSlots, function (filled, slotName) {\n if (!filled) {\n throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);\n }\n });\n for (var slotName in slots) {\n if (slots[slotName]) {\n // Only define a transclusion function if the slot was filled\n var slotCompileNodes = jqLite(slots[slotName].childNodes);\n slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slotCompileNodes, transcludeFn);\n }\n }\n $template = jqLite($template.childNodes);\n }\n $compileNode.empty(); // clear contents\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined, undefined, {\n needsNewScope: directive.$$isolateScope || directive.$$newScope\n });\n childTranscludeFn.$$slots = slots;\n }\n }\n if (directive.template) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n directiveValue = isFunction(directive.template) ? directive.template($compileNode, templateAttrs) : directive.template;\n directiveValue = denormalizeTemplate(directiveValue);\n if (directive.replace) {\n replaceDirective = directive;\n if (jqLiteIsTextNode(directiveValue)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n }\n compileNode = $template[0];\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt', 'Template for directive \\'{0}\\' must have exactly one root element. {1}', directiveName, '');\n }\n replaceWith(jqCollection, $compileNode, compileNode);\n var newTemplateAttrs = {\n $attr: {}\n };\n\n // combine directives from the original node and from the template:\n // - take the array of directives for this element\n // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n // - collect directives from the template and sort them by priority\n // - combine directives as: processed + template + unprocessed\n var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n if (newIsolateScopeDirective || newScopeDirective) {\n // The original directive caused the current element to be replaced but this element\n // also needs to have a new scope, so we need to tell the template directives\n // that they would need to get their scope from further up, if they require transclusion\n markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);\n }\n directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n ii = directives.length;\n } else {\n $compileNode.html(directiveValue);\n }\n }\n if (directive.templateUrl) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n if (directive.replace) {\n replaceDirective = directive;\n }\n\n // eslint-disable-next-line no-func-assign\n nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode, templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n controllerDirectives: controllerDirectives,\n newScopeDirective: newScopeDirective !== directive && newScopeDirective,\n newIsolateScopeDirective: newIsolateScopeDirective,\n templateDirective: templateDirective,\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n ii = directives.length;\n } else if (directive.compile) {\n try {\n linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n var context = directive.$$originalDirective || directive;\n if (isFunction(linkFn)) {\n addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);\n } else if (linkFn) {\n addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd);\n }\n } catch (e) {\n $exceptionHandler(e, startingTag($compileNode));\n }\n }\n if (directive.terminal) {\n nodeLinkFn.terminal = true;\n terminalPriority = Math.max(terminalPriority, directive.priority);\n }\n }\n nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n nodeLinkFn.templateOnThisElement = hasTemplate;\n nodeLinkFn.transclude = childTranscludeFn;\n previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n return nodeLinkFn;\n\n ////////////////////\n\n function addLinkFns(pre, post, attrStart, attrEnd) {\n if (pre) {\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n pre.require = directive.require;\n pre.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n pre = cloneAndAnnotateFn(pre, {\n isolateScope: true\n });\n }\n preLinkFns.push(pre);\n }\n if (post) {\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n post.require = directive.require;\n post.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {\n isolateScope: true\n });\n }\n postLinkFns.push(post);\n }\n }\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element, attrs, scopeBindingInfo;\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n $element = templateAttrs.$$element;\n } else {\n $element = jqLite(linkNode);\n attrs = new Attributes($element, templateAttrs);\n }\n controllerScope = scope;\n if (newIsolateScopeDirective) {\n isolateScope = scope.$new(true);\n } else if (newScopeDirective) {\n controllerScope = scope.$parent;\n }\n if (boundTranscludeFn) {\n // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n transcludeFn = controllersBoundTransclude;\n transcludeFn.$$boundTransclude = boundTranscludeFn;\n // expose the slots on the `$transclude` function\n transcludeFn.isSlotFilled = function (slotName) {\n return !!boundTranscludeFn.$$slots[slotName];\n };\n }\n if (controllerDirectives) {\n elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);\n }\n if (newIsolateScopeDirective) {\n // Initialize isolate scope bindings for new isolate scope directive.\n compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective || templateDirective === newIsolateScopeDirective.$$originalDirective)));\n compile.$$addScopeClass($element, true);\n isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings;\n scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope, isolateScope.$$isolateBindings, newIsolateScopeDirective);\n if (scopeBindingInfo.removeWatches) {\n isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);\n }\n }\n\n // Initialize bindToController bindings\n for (var name in elementControllers) {\n var controllerDirective = controllerDirectives[name];\n var controller = elementControllers[name];\n var bindings = controllerDirective.$$bindings.bindToController;\n controller.instance = controller();\n $element.data('$' + controllerDirective.name + 'Controller', controller.instance);\n controller.bindingInfo = initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n\n // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy\n forEach(controllerDirectives, function (controllerDirective, name) {\n var require = controllerDirective.require;\n if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {\n extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));\n }\n });\n\n // Handle the init and destroy lifecycle hooks on all controllers that have them\n forEach(elementControllers, function (controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$onChanges)) {\n try {\n controllerInstance.$onChanges(controller.bindingInfo.initialChanges);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$onInit)) {\n try {\n controllerInstance.$onInit();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$doCheck)) {\n controllerScope.$watch(function () {\n controllerInstance.$doCheck();\n });\n controllerInstance.$doCheck();\n }\n if (isFunction(controllerInstance.$onDestroy)) {\n controllerScope.$on('$destroy', function callOnDestroyHook() {\n controllerInstance.$onDestroy();\n });\n }\n });\n\n // PRELINKING\n for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n linkFn = preLinkFns[i];\n invokeLinkFn(linkFn, linkFn.isolateScope ? isolateScope : scope, $element, attrs, linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn);\n }\n\n // RECURSION\n // We only pass the isolate scope, if the isolate directive has a template,\n // otherwise the child elements do not belong to the isolate directive.\n var scopeToChild = scope;\n if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n scopeToChild = isolateScope;\n }\n if (childLinkFn) {\n childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n }\n\n // POSTLINKING\n for (i = postLinkFns.length - 1; i >= 0; i--) {\n linkFn = postLinkFns[i];\n invokeLinkFn(linkFn, linkFn.isolateScope ? isolateScope : scope, $element, attrs, linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers), transcludeFn);\n }\n\n // Trigger $postLink lifecycle hooks\n forEach(elementControllers, function (controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$postLink)) {\n controllerInstance.$postLink();\n }\n });\n\n // This is the function that is injected as `$transclude`.\n // Note: all arguments are optional!\n function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot', 'No parent directive that requires a transclusion with slot name \"{0}\". ' + 'Element: {1}', slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }\n }\n }\n function getControllers(directiveName, require, $element, elementControllers) {\n var value;\n if (isString(require)) {\n var match = require.match(REQUIRE_PREFIX_REGEXP);\n var name = require.substring(match[0].length);\n var inheritType = match[1] || match[3];\n var optional = match[2] === '?';\n\n //If only parents then start at the parent element\n if (inheritType === '^^') {\n $element = $element.parent();\n //Otherwise attempt getting the controller from elementControllers in case\n //the element is transcluded (and has no data) and to avoid .data if possible\n } else {\n value = elementControllers && elementControllers[name];\n value = value && value.instance;\n }\n if (!value) {\n var dataName = '$' + name + 'Controller';\n if (inheritType === '^^' && $element[0] && $element[0].nodeType === NODE_TYPE_DOCUMENT) {\n // inheritedData() uses the documentElement when it finds the document, so we would\n // require from the element itself.\n value = null;\n } else {\n value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);\n }\n }\n if (!value && !optional) {\n throw $compileMinErr('ctreq', 'Controller \\'{0}\\', required by directive \\'{1}\\', can\\'t be found!', name, directiveName);\n }\n } else if (isArray(require)) {\n value = [];\n for (var i = 0, ii = require.length; i < ii; i++) {\n value[i] = getControllers(directiveName, require[i], $element, elementControllers);\n }\n } else if (isObject(require)) {\n value = {};\n forEach(require, function (controller, property) {\n value[property] = getControllers(directiveName, controller, $element, elementControllers);\n });\n }\n return value || null;\n }\n function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {\n var elementControllers = createMap();\n for (var controllerKey in controllerDirectives) {\n var directive = controllerDirectives[controllerKey];\n var locals = {\n $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n $element: $element,\n $attrs: attrs,\n $transclude: transcludeFn\n };\n var controller = directive.controller;\n if (controller === '@') {\n controller = attrs[directive.name];\n }\n var controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n // For directives with element transclusion the element is a comment.\n // In this case .data will not attach any data.\n // Instead, we save the controllers for the element in a local hash and attach to .data\n // later, once we have the actual element.\n elementControllers[directive.name] = controllerInstance;\n $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n }\n return elementControllers;\n }\n\n // Depending upon the context in which a directive finds itself it might need to have a new isolated\n // or child scope created. For instance:\n // * if the directive has been pulled into a template because another directive with a higher priority\n // asked for element transclusion\n // * if the directive itself asks for transclusion but it is at the root of a template and the original\n // element was replaced. See https://github.com/angular/angular.js/issues/12936\n function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {\n $$isolateScope: isolateScope,\n $$newScope: newScope\n });\n }\n }\n\n /**\n * looks up the directive and decorates it with exception handling and proper parameters. We\n * call this the boundDirective.\n *\n * @param {string} name name of the directive to look up.\n * @param {string} location The directive must be found in specific format.\n * String containing any of theses characters:\n *\n * * `E`: element name\n * * `A': attribute\n * * `C`: class\n * * `M`: comment\n * @returns {boolean} true if directive was added.\n */\n function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName, endAttrName) {\n if (name === ignoreDirective) return null;\n var match = null;\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix), i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if ((isUndefined(maxPriority) || maxPriority > directive.priority) && directive.restrict.indexOf(location) !== -1) {\n if (startAttrName) {\n directive = inherit(directive, {\n $$start: startAttrName,\n $$end: endAttrName\n });\n }\n if (!directive.$$bindings) {\n var bindings = directive.$$bindings = parseDirectiveBindings(directive, directive.name);\n if (isObject(bindings.isolateScope)) {\n directive.$$isolateBindings = bindings.isolateScope;\n }\n }\n tDirectives.push(directive);\n match = directive;\n }\n }\n }\n return match;\n }\n\n /**\n * looks up the directive and returns true if it is a multi-element directive,\n * and therefore requires DOM nodes between -start and -end markers to be grouped\n * together.\n *\n * @param {string} name name of the directive to look up.\n * @returns true if directive was registered as multi-element.\n */\n function directiveIsMultiElement(name) {\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix), i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if (directive.multiElement) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * When the element is replaced with HTML template then the new attributes\n * on the template need to be merged with the existing attributes in the DOM.\n * The desired effect is to have both of the attributes present.\n *\n * @param {object} dst destination attributes (original DOM)\n * @param {object} src source attributes (from the directive template)\n */\n function mergeTemplateAttributes(dst, src) {\n var srcAttr = src.$attr,\n dstAttr = dst.$attr;\n\n // reapply the old attributes to the new element\n forEach(dst, function (value, key) {\n if (key.charAt(0) !== '$') {\n if (src[key] && src[key] !== value) {\n if (value.length) {\n value += (key === 'style' ? ';' : ' ') + src[key];\n } else {\n value = src[key];\n }\n }\n dst.$set(key, value, true, srcAttr[key]);\n }\n });\n\n // copy the new attributes on the old attrs object\n forEach(src, function (value, key) {\n // Check if we already set this attribute in the loop above.\n // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') {\n dst[key] = value;\n if (key !== 'class' && key !== 'style') {\n dstAttr[key] = srcAttr[key];\n }\n }\n });\n }\n function compileTemplateUrl(directives, $compileNode, tAttrs, $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n var linkQueue = [],\n afterTemplateNodeLinkFn,\n afterTemplateChildLinkFn,\n beforeTemplateCompileNode = $compileNode[0],\n origAsyncDirective = directives.shift(),\n derivedSyncDirective = inherit(origAsyncDirective, {\n templateUrl: null,\n transclude: null,\n replace: null,\n $$originalDirective: origAsyncDirective\n }),\n templateUrl = isFunction(origAsyncDirective.templateUrl) ? origAsyncDirective.templateUrl($compileNode, tAttrs) : origAsyncDirective.templateUrl,\n templateNamespace = origAsyncDirective.templateNamespace;\n $compileNode.empty();\n $templateRequest(templateUrl).then(function (content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n content = denormalizeTemplate(content);\n if (origAsyncDirective.replace) {\n if (jqLiteIsTextNode(content)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n }\n compileNode = $template[0];\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt', 'Template for directive \\'{0}\\' must have exactly one root element. {1}', origAsyncDirective.name, templateUrl);\n }\n tempTemplateAttrs = {\n $attr: {}\n };\n replaceWith($rootElement, $compileNode, compileNode);\n var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n if (isObject(origAsyncDirective.scope)) {\n // the original directive that caused the template to be loaded async required\n // an isolate scope\n markDirectiveScope(templateDirectives, true);\n }\n directives = templateDirectives.concat(directives);\n mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n } else {\n compileNode = beforeTemplateCompileNode;\n $compileNode.html(content);\n }\n directives.unshift(derivedSyncDirective);\n afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns, previousCompileContext);\n forEach($rootElement, function (node, i) {\n if (node === compileNode) {\n $rootElement[i] = $compileNode[0];\n }\n });\n afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n while (linkQueue.length) {\n var scope = linkQueue.shift(),\n beforeTemplateLinkNode = linkQueue.shift(),\n linkRootElement = linkQueue.shift(),\n boundTranscludeFn = linkQueue.shift(),\n linkNode = $compileNode[0];\n if (scope.$$destroyed) continue;\n if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n var oldClasses = beforeTemplateLinkNode.className;\n if (!(previousCompileContext.hasElementTranscludeDirective && origAsyncDirective.replace)) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n }\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n // Copy in CSS classes from original node\n safeAddClass(jqLite(linkNode), oldClasses);\n }\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement, childBoundTranscludeFn);\n }\n linkQueue = null;\n }).catch(function (error) {\n if (isError(error)) {\n $exceptionHandler(error);\n }\n });\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n var childBoundTranscludeFn = boundTranscludeFn;\n if (scope.$$destroyed) return;\n if (linkQueue) {\n linkQueue.push(scope, node, rootElement, childBoundTranscludeFn);\n } else {\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n }\n };\n }\n\n /**\n * Sorting function for bound directives.\n */\n function byPriority(a, b) {\n var diff = b.priority - a.priority;\n if (diff !== 0) return diff;\n if (a.name !== b.name) return a.name < b.name ? -1 : 1;\n return a.index - b.index;\n }\n function assertNoDuplicate(what, previousDirective, directive, element) {\n function wrapModuleNameIfDefined(moduleName) {\n return moduleName ? ' (module: ' + moduleName + ')' : '';\n }\n if (previousDirective) {\n throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}', previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName), directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));\n }\n }\n function addTextInterpolateDirective(directives, text) {\n var interpolateFn = $interpolate(text, true);\n if (interpolateFn) {\n directives.push({\n priority: 0,\n compile: function textInterpolateCompileFn(templateNode) {\n var templateNodeParent = templateNode.parent(),\n hasCompileParent = !!templateNodeParent.length;\n\n // When transcluding a template that has bindings in the root\n // we don't have a parent and thus need to add the class during linking fn.\n if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n return function textInterpolateLinkFn(scope, node) {\n var parent = node.parent();\n if (!hasCompileParent) compile.$$addBindingClass(parent);\n compile.$$addBindingInfo(parent, interpolateFn.expressions);\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n };\n }\n });\n }\n }\n function wrapTemplate(type, template) {\n type = lowercase(type || 'html');\n switch (type) {\n case 'svg':\n case 'math':\n var wrapper = window.document.createElement('div');\n wrapper.innerHTML = '<' + type + '>' + template + '';\n return wrapper.childNodes[0].childNodes;\n default:\n return template;\n }\n }\n function getTrustedAttrContext(nodeName, attrNormalizedName) {\n if (attrNormalizedName === 'srcdoc') {\n return $sce.HTML;\n }\n // All nodes with src attributes require a RESOURCE_URL value, except for\n // img and various html5 media nodes, which require the MEDIA_URL context.\n if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') {\n if (['img', 'video', 'audio', 'source', 'track'].indexOf(nodeName) === -1) {\n return $sce.RESOURCE_URL;\n }\n return $sce.MEDIA_URL;\n } else if (attrNormalizedName === 'xlinkHref') {\n // Some xlink:href are okay, most aren't\n if (nodeName === 'image') return $sce.MEDIA_URL;\n if (nodeName === 'a') return $sce.URL;\n return $sce.RESOURCE_URL;\n } else if (\n // Formaction\n nodeName === 'form' && attrNormalizedName === 'action' ||\n // If relative URLs can go where they are not expected to, then\n // all sorts of trust issues can arise.\n nodeName === 'base' && attrNormalizedName === 'href' ||\n // links can be stylesheets or imports, which can run script in the current origin\n nodeName === 'link' && attrNormalizedName === 'href') {\n return $sce.RESOURCE_URL;\n } else if (nodeName === 'a' && (attrNormalizedName === 'href' || attrNormalizedName === 'ngHref')) {\n return $sce.URL;\n }\n }\n function getTrustedPropContext(nodeName, propNormalizedName) {\n var prop = propNormalizedName.toLowerCase();\n return PROP_CONTEXTS[nodeName + '|' + prop] || PROP_CONTEXTS['*|' + prop];\n }\n function sanitizeSrcsetPropertyValue(value) {\n return sanitizeSrcset($sce.valueOf(value), 'ng-prop-srcset');\n }\n function addPropertyDirective(node, directives, attrName, propName) {\n if (EVENT_HANDLER_ATTR_REGEXP.test(propName)) {\n throw $compileMinErr('nodomevents', 'Property bindings for HTML DOM event properties are disallowed');\n }\n var nodeName = nodeName_(node);\n var trustedContext = getTrustedPropContext(nodeName, propName);\n var sanitizer = identity;\n // Sanitize img[srcset] + source[srcset] values.\n if (propName === 'srcset' && (nodeName === 'img' || nodeName === 'source')) {\n sanitizer = sanitizeSrcsetPropertyValue;\n } else if (trustedContext) {\n sanitizer = $sce.getTrusted.bind($sce, trustedContext);\n }\n directives.push({\n priority: 100,\n compile: function ngPropCompileFn(_, attr) {\n var ngPropGetter = $parse(attr[attrName]);\n var ngPropWatch = $parse(attr[attrName], function sceValueOf(val) {\n // Unwrap the value to compare the actual inner safe value, not the wrapper object.\n return $sce.valueOf(val);\n });\n return {\n pre: function ngPropPreLinkFn(scope, $element) {\n function applyPropValue() {\n var propValue = ngPropGetter(scope);\n $element[0][propName] = sanitizer(propValue);\n }\n applyPropValue();\n scope.$watch(ngPropWatch, applyPropValue);\n }\n };\n }\n });\n }\n function addEventDirective(directives, attrName, eventName) {\n directives.push(createEventDirective($parse, $rootScope, $exceptionHandler, attrName, eventName, /*forceAsync=*/false));\n }\n function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {\n var nodeName = nodeName_(node);\n var trustedContext = getTrustedAttrContext(nodeName, name);\n var mustHaveExpression = !isNgAttr;\n var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr;\n var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing);\n\n // no interpolation found -> ignore\n if (!interpolateFn) return;\n if (name === 'multiple' && nodeName === 'select') {\n throw $compileMinErr('selmulti', 'Binding to the \\'multiple\\' attribute is not supported. Element: {0}', startingTag(node));\n }\n if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n throw $compileMinErr('nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');\n }\n directives.push({\n priority: 100,\n compile: function () {\n return {\n pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n var $$observers = attr.$$observers || (attr.$$observers = createMap());\n\n // If the attribute has changed since last $interpolate()ed\n var newValue = attr[name];\n if (newValue !== value) {\n // we need to interpolate again since the attribute value has been updated\n // (e.g. by another directive's compile function)\n // ensure unset/empty values make interpolateFn falsy\n interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n value = newValue;\n }\n\n // if attribute was updated so that there is no interpolation going on we don't want to\n // register any observers\n if (!interpolateFn) return;\n\n // initialize attr object so that it's ready in case we need the value for isolate\n // scope initialization, otherwise the value would not be available from isolate\n // directive's linking fn during linking phase\n attr[name] = interpolateFn(scope);\n ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n (attr.$$observers && attr.$$observers[name].$$scope || scope).$watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n //special case for class attribute addition + removal\n //so that class changes can tap into the animation\n //hooks provided by the $animate service. Be sure to\n //skip animations when the first digest occurs (when\n //both the new and the old values are the same) since\n //the CSS classes are the non-interpolated values\n if (name === 'class' && newValue !== oldValue) {\n attr.$updateClass(newValue, oldValue);\n } else {\n attr.$set(name, newValue);\n }\n });\n }\n };\n }\n });\n }\n\n /**\n * This is a special jqLite.replaceWith, which can replace items which\n * have no parents, provided that the containing jqLite collection is provided.\n *\n * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n * in the root of the tree.\n * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n * the shell, but replace its DOM node reference.\n * @param {Node} newNode The new DOM node.\n */\n function replaceWith($rootElement, elementsToRemove, newNode) {\n var firstElementToRemove = elementsToRemove[0],\n removeCount = elementsToRemove.length,\n parent = firstElementToRemove.parentNode,\n i,\n ii;\n if ($rootElement) {\n for (i = 0, ii = $rootElement.length; i < ii; i++) {\n if ($rootElement[i] === firstElementToRemove) {\n $rootElement[i++] = newNode;\n for (var j = i, j2 = j + removeCount - 1, jj = $rootElement.length; j < jj; j++, j2++) {\n if (j2 < jj) {\n $rootElement[j] = $rootElement[j2];\n } else {\n delete $rootElement[j];\n }\n }\n $rootElement.length -= removeCount - 1;\n\n // If the replaced element is also the jQuery .context then replace it\n // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n // http://api.jquery.com/context/\n if ($rootElement.context === firstElementToRemove) {\n $rootElement.context = newNode;\n }\n break;\n }\n }\n }\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n\n // Append all the `elementsToRemove` to a fragment. This will...\n // - remove them from the DOM\n // - allow them to still be traversed with .nextSibling\n // - allow a single fragment.qSA to fetch all elements being removed\n var fragment = window.document.createDocumentFragment();\n for (i = 0; i < removeCount; i++) {\n fragment.appendChild(elementsToRemove[i]);\n }\n if (jqLite.hasData(firstElementToRemove)) {\n // Copy over user data (that includes AngularJS's $scope etc.). Don't copy private\n // data here because there's no public interface in jQuery to do that and copying over\n // event listeners (which is the main use of private data) wouldn't work anyway.\n jqLite.data(newNode, jqLite.data(firstElementToRemove));\n\n // Remove $destroy event listeners from `firstElementToRemove`\n jqLite(firstElementToRemove).off('$destroy');\n }\n\n // Cleanup any data/listeners on the elements and children.\n // This includes invoking the $destroy event on any elements with listeners.\n jqLite.cleanData(fragment.querySelectorAll('*'));\n\n // Update the jqLite collection to only contain the `newNode`\n for (i = 1; i < removeCount; i++) {\n delete elementsToRemove[i];\n }\n elementsToRemove[0] = newNode;\n elementsToRemove.length = 1;\n }\n function cloneAndAnnotateFn(fn, annotation) {\n return extend(function () {\n return fn.apply(null, arguments);\n }, fn, annotation);\n }\n function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n try {\n linkFn(scope, $element, attrs, controllers, transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n function strictBindingsCheck(attrName, directiveName) {\n if (strictComponentBindingsEnabled) {\n throw $compileMinErr('missingattr', 'Attribute \\'{0}\\' of \\'{1}\\' is non-optional and must be set!', attrName, directiveName);\n }\n }\n\n // Set up $watches for isolate scope and controller bindings.\n function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {\n var removeWatchCollection = [];\n var initialChanges = {};\n var changes;\n forEach(bindings, function initializeBinding(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode,\n // @, =, <, or &\n lastValue,\n parentGet,\n parentSet,\n compare,\n removeWatch;\n switch (mode) {\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n destination[scopeName] = attrs[attrName] = undefined;\n }\n removeWatch = attrs.$observe(attrName, function (value) {\n if (isString(value) || isBoolean(value)) {\n var oldValue = destination[scopeName];\n recordChanges(scopeName, value, oldValue);\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n lastValue = attrs[attrName];\n if (isString(lastValue)) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(lastValue)(scope);\n } else if (isBoolean(lastValue)) {\n // If the attributes is one of the BOOLEAN_ATTR then AngularJS will have converted\n // the value to boolean rather than a string, so we special case this situation\n destination[scopeName] = lastValue;\n }\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n removeWatchCollection.push(removeWatch);\n break;\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = simpleCompare;\n }\n parentSet = parentGet.assign || function () {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign', 'Expression \\'{0}\\' in attribute \\'{1}\\' used with directive \\'{2}\\' is non-assignable!', attrs[attrName], attrName, directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n lastValue = parentValue;\n return lastValue;\n };\n parentValueWatch.$stateful = true;\n if (definition.collection) {\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n removeWatchCollection.push(removeWatch);\n break;\n case '<':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n parentGet = $parse(attrs[attrName]);\n var isLiteral = parentGet.literal;\n var initialValue = destination[scopeName] = parentGet(scope);\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n removeWatch = scope[definition.collection ? '$watchCollection' : '$watch'](parentGet, function parentValueWatchAction(newValue, oldValue) {\n if (oldValue === newValue) {\n if (oldValue === initialValue || isLiteral && equals(oldValue, initialValue)) {\n return;\n }\n oldValue = initialValue;\n }\n recordChanges(scopeName, newValue, oldValue);\n destination[scopeName] = newValue;\n });\n removeWatchCollection.push(removeWatch);\n break;\n case '&':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n }\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n destination[scopeName] = function (locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n function recordChanges(key, currentValue, previousValue) {\n if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) {\n // If we have not already scheduled the top level onChangesQueue handler then do so now\n if (!onChangesQueue) {\n scope.$$postDigest(flushOnChangesQueue);\n onChangesQueue = [];\n }\n // If we have not already queued a trigger of onChanges for this controller then do so now\n if (!changes) {\n changes = {};\n onChangesQueue.push(triggerOnChangesHook);\n }\n // If the has been a change on this property already then we need to reuse the previous value\n if (changes[key]) {\n previousValue = changes[key].previousValue;\n }\n // Store this change\n changes[key] = new SimpleChange(previousValue, currentValue);\n }\n }\n function triggerOnChangesHook() {\n destination.$onChanges(changes);\n // Now clear the changes so that we schedule onChanges when more changes arrive\n changes = undefined;\n }\n return {\n initialChanges: initialChanges,\n removeWatches: removeWatchCollection.length && function removeWatches() {\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {\n removeWatchCollection[i]();\n }\n }\n };\n }\n }];\n }\n function SimpleChange(previous, current) {\n this.previousValue = previous;\n this.currentValue = current;\n }\n SimpleChange.prototype.isFirstChange = function () {\n return this.previousValue === _UNINITIALIZED_VALUE;\n };\n var PREFIX_REGEXP = /^((?:x|data)[:\\-_])/i;\n var SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n\n /**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\n function directiveNormalize(name) {\n return name.replace(PREFIX_REGEXP, '').replace(SPECIAL_CHARS_REGEXP, function (_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n }\n\n /**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in AngularJS:\n *\n * ```\n * \n * ```\n */\n\n /**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n * property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n /**\n * Closure compiler type information\n */\n\n function nodesetLinkingFn( /* angular.Scope */scope, /* NodeList */nodeList, /* Element */rootElement, /* function(Function) */boundTranscludeFn) {}\n function directiveLinkingFn( /* nodesetLinkingFn */nodesetLinkingFn, /* angular.Scope */scope, /* Node */node, /* Element */rootElement, /* function(Function) */boundTranscludeFn) {}\n function tokenDifference(str1, str2) {\n var values = '',\n tokens1 = str1.split(/\\s+/),\n tokens2 = str2.split(/\\s+/);\n outer: for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values += (values.length > 0 ? ' ' : '') + token;\n }\n return values;\n }\n function removeComments(jqNodes) {\n jqNodes = jqLite(jqNodes);\n var i = jqNodes.length;\n if (i <= 1) {\n return jqNodes;\n }\n while (i--) {\n var node = jqNodes[i];\n if (node.nodeType === NODE_TYPE_COMMENT || node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '') {\n splice.call(jqNodes, i, 1);\n }\n }\n return jqNodes;\n }\n var $controllerMinErr = minErr('$controller');\n var CNTRL_REG = /^(\\S+)(\\s+as\\s+([\\w$]+))?$/;\n function identifierForController(controller, ident) {\n if (ident && isString(ident)) return ident;\n if (isString(controller)) {\n var match = CNTRL_REG.exec(controller);\n if (match) return match[3];\n }\n }\n\n /**\n * @ngdoc provider\n * @name $controllerProvider\n * @this\n *\n * @description\n * The {@link ng.$controller $controller service} is used by AngularJS to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\n function $ControllerProvider() {\n var controllers = {};\n\n /**\n * @ngdoc method\n * @name $controllerProvider#has\n * @param {string} name Controller name to check.\n */\n this.has = function (name) {\n return controllers.hasOwnProperty(name);\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#register\n * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n * the names and the values are the constructors.\n * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n * annotations in the array notation).\n */\n this.register = function (name, constructor) {\n assertNotHasOwnProperty(name, 'controller');\n if (isObject(name)) {\n extend(controllers, name);\n } else {\n controllers[name] = constructor;\n }\n };\n this.$get = ['$injector', function ($injector) {\n /**\n * @ngdoc service\n * @name $controller\n * @requires $injector\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @return {Object} Instance of given controller.\n *\n * @description\n * `$controller` service is responsible for instantiating controllers.\n *\n * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n */\n return function $controller(expression, locals, later, ident) {\n // PRIVATE API:\n // param `later` --- indicates that the controller's constructor is invoked at a later time.\n // If true, $controller will allocate the object with the correct\n // prototype chain, but will not invoke the controller until a returned\n // callback is invoked.\n // param `ident` --- An optional label which overrides the label parsed from the controller\n // expression, if any.\n var instance, match, constructor, identifier;\n later = later === true;\n if (ident && isString(ident)) {\n identifier = ident;\n }\n if (isString(expression)) {\n match = expression.match(CNTRL_REG);\n if (!match) {\n throw $controllerMinErr('ctrlfmt', 'Badly formed controller string \\'{0}\\'. ' + 'Must match `__name__ as __id__` or `__name__`.', expression);\n }\n constructor = match[1];\n identifier = identifier || match[3];\n expression = controllers.hasOwnProperty(constructor) ? controllers[constructor] : getter(locals.$scope, constructor, true);\n if (!expression) {\n throw $controllerMinErr('ctrlreg', 'The controller with the name \\'{0}\\' is not registered.', constructor);\n }\n assertArgFn(expression, constructor, true);\n }\n if (later) {\n // Instantiate controller later:\n // This machinery is used to create an instance of the object before calling the\n // controller's constructor itself.\n //\n // This allows properties to be added to the controller before the constructor is\n // invoked. Primarily, this is used for isolate scope bindings in $compile.\n //\n // This feature is not intended for use by applications, and is thus not documented\n // publicly.\n // Object creation: http://jsperf.com/create-constructor/2\n var controllerPrototype = (isArray(expression) ? expression[expression.length - 1] : expression).prototype;\n instance = Object.create(controllerPrototype || null);\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n return extend(function $controllerInit() {\n var result = $injector.invoke(expression, instance, locals, constructor);\n if (result !== instance && (isObject(result) || isFunction(result))) {\n instance = result;\n if (identifier) {\n // If result changed, re-assign controllerAs value to scope.\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n }\n return instance;\n }, {\n instance: instance,\n identifier: identifier\n });\n }\n instance = $injector.instantiate(expression, locals, constructor);\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n return instance;\n };\n function addIdentifier(locals, identifier, instance, name) {\n if (!(locals && isObject(locals.$scope))) {\n throw minErr('$controller')('noscp', 'Cannot export controller \\'{0}\\' as \\'{1}\\'! No $scope object provided via `locals`.', name, identifier);\n }\n locals.$scope[identifier] = instance;\n }\n }];\n }\n\n /**\n * @ngdoc service\n * @name $document\n * @requires $window\n * @this\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n \n \n
\n

$document title:

\n

window.document title:

\n
\n
\n \n angular.module('documentExample', [])\n .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n $scope.title = $document[0].title;\n $scope.windowTitle = angular.element(window.document)[0].title;\n }]);\n \n
\n */\n function $DocumentProvider() {\n this.$get = ['$window', function (window) {\n return jqLite(window.document);\n }];\n }\n\n /**\n * @private\n * @this\n * Listens for document visibility change and makes the current status accessible.\n */\n function $$IsDocumentHiddenProvider() {\n this.$get = ['$document', '$rootScope', function ($document, $rootScope) {\n var doc = $document[0];\n var hidden = doc && doc.hidden;\n $document.on('visibilitychange', changeListener);\n $rootScope.$on('$destroy', function () {\n $document.off('visibilitychange', changeListener);\n });\n function changeListener() {\n hidden = doc.hidden;\n }\n return function () {\n return hidden;\n };\n }];\n }\n\n /**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n * @this\n *\n * @description\n * Any uncaught exception in AngularJS expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught\n * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead\n * of `$log.error()`.\n *\n * ```js\n * angular.\n * module('exceptionOverwrite', []).\n * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {\n * return function myExceptionHandler(exception, cause) {\n * logErrorsToBackend(exception, cause);\n * $log.warn(exception, cause);\n * };\n * }]);\n * ```\n *\n *
\n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause Optional information about the context in which\n * the error was thrown.\n *\n */\n function $ExceptionHandlerProvider() {\n this.$get = ['$log', function ($log) {\n return function (exception, cause) {\n $log.error.apply($log, arguments);\n };\n }];\n }\n var $$ForceReflowProvider = /** @this */function () {\n this.$get = ['$document', function ($document) {\n return function (domNode) {\n //the line below will force the browser to perform a repaint so\n //that all the animated elements within the animation frame will\n //be properly updated and drawn on screen. This is required to\n //ensure that the preparation animation is properly flushed so that\n //the active state picks up from there. DO NOT REMOVE THIS LINE.\n //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH\n //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND\n //WILL TAKE YEARS AWAY FROM YOUR LIFE.\n if (domNode) {\n if (!domNode.nodeType && domNode instanceof jqLite) {\n domNode = domNode[0];\n }\n } else {\n domNode = $document[0].body;\n }\n return domNode.offsetWidth + 1;\n };\n }];\n };\n var APPLICATION_JSON = 'application/json';\n var CONTENT_TYPE_APPLICATION_JSON = {\n 'Content-Type': APPLICATION_JSON + ';charset=utf-8'\n };\n var JSON_START = /^\\[|^\\{(?!\\{)/;\n var JSON_ENDS = {\n '[': /]$/,\n '{': /}$/\n };\n var JSON_PROTECTION_PREFIX = /^\\)]\\}',?\\n/;\n var $httpMinErr = minErr('$http');\n function serializeValue(v) {\n if (isObject(v)) {\n return isDate(v) ? v.toISOString() : toJson(v);\n }\n return v;\n }\n\n /** @this */\n function $HttpParamSerializerProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializer\n * @description\n *\n * Default {@link $http `$http`} params serializer that converts objects to strings\n * according to the following rules:\n *\n * * `{'foo': 'bar'}` results in `foo=bar`\n * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)\n * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)\n * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)\n *\n * Note that serializer will sort the request parameters alphabetically.\n */\n\n this.$get = function () {\n return function ngParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n forEachSorted(params, function (value, key) {\n if (value === null || isUndefined(value) || isFunction(value)) return;\n if (isArray(value)) {\n forEach(value, function (v) {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));\n });\n } else {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\n }\n });\n return parts.join('&');\n };\n };\n }\n\n /** @this */\n function $HttpParamSerializerJQLikeProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializerJQLike\n *\n * @description\n *\n * Alternative {@link $http `$http`} params serializer that follows\n * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.\n * The serializer will also sort the params alphabetically.\n *\n * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:\n *\n * ```js\n * $http({\n * url: myUrl,\n * method: 'GET',\n * params: myParams,\n * paramSerializer: '$httpParamSerializerJQLike'\n * });\n * ```\n *\n * It is also possible to set it as the default `paramSerializer` in the\n * {@link $httpProvider#defaults `$httpProvider`}.\n *\n * Additionally, you can inject the serializer and use it explicitly, for example to serialize\n * form data for submission:\n *\n * ```js\n * .controller(function($http, $httpParamSerializerJQLike) {\n * //...\n *\n * $http({\n * url: myUrl,\n * method: 'POST',\n * data: $httpParamSerializerJQLike(myData),\n * headers: {\n * 'Content-Type': 'application/x-www-form-urlencoded'\n * }\n * });\n *\n * });\n * ```\n *\n */\n this.$get = function () {\n return function jQueryLikeParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n serialize(params, '', true);\n return parts.join('&');\n function serialize(toSerialize, prefix, topLevel) {\n if (isArray(toSerialize)) {\n forEach(toSerialize, function (value, index) {\n serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');\n });\n } else if (isObject(toSerialize) && !isDate(toSerialize)) {\n forEachSorted(toSerialize, function (value, key) {\n serialize(value, prefix + (topLevel ? '' : '[') + key + (topLevel ? '' : ']'));\n });\n } else {\n if (isFunction(toSerialize)) {\n toSerialize = toSerialize();\n }\n parts.push(encodeUriQuery(prefix) + '=' + (toSerialize == null ? '' : encodeUriQuery(serializeValue(toSerialize))));\n }\n }\n };\n };\n }\n function defaultHttpResponseTransform(data, headers) {\n if (isString(data)) {\n // Strip json vulnerability protection prefix and trim whitespace\n var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n if (tempData) {\n var contentType = headers('Content-Type');\n var hasJsonContentType = contentType && contentType.indexOf(APPLICATION_JSON) === 0;\n if (hasJsonContentType || isJsonLike(tempData)) {\n try {\n data = fromJson(tempData);\n } catch (e) {\n if (!hasJsonContentType) {\n return data;\n }\n throw $httpMinErr('baddata', 'Data must be a valid JSON object. Received: \"{0}\". ' + 'Parse error: \"{1}\"', data, e);\n }\n }\n }\n }\n return data;\n }\n function isJsonLike(str) {\n var jsonStart = str.match(JSON_START);\n return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n }\n\n /**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\n function parseHeaders(headers) {\n var parsed = createMap(),\n i;\n function fillInParsed(key, val) {\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n if (isString(headers)) {\n forEach(headers.split('\\n'), function (line) {\n i = line.indexOf(':');\n fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));\n });\n } else if (isObject(headers)) {\n forEach(headers, function (headerVal, headerKey) {\n fillInParsed(lowercase(headerKey), trim(headerVal));\n });\n }\n return parsed;\n }\n\n /**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n * - if called with an argument returns a single header value or null\n * - if called with no arguments returns an object containing all headers.\n */\n function headersGetter(headers) {\n var headersObj;\n return function (name) {\n if (!headersObj) headersObj = parseHeaders(headers);\n if (name) {\n var value = headersObj[lowercase(name)];\n if (value === undefined) {\n value = null;\n }\n return value;\n }\n return headersObj;\n };\n }\n\n /**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\n function transformData(data, headers, status, fns) {\n if (isFunction(fns)) {\n return fns(data, headers, status);\n }\n forEach(fns, function (fn) {\n data = fn(data, headers, status);\n });\n return data;\n }\n function isSuccess(status) {\n return 200 <= status && status < 300;\n }\n\n /**\n * @ngdoc provider\n * @name $httpProvider\n * @this\n *\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n */\n function $HttpProvider() {\n /**\n * @ngdoc property\n * @name $httpProvider#defaults\n * @description\n *\n * Object containing default values for all {@link ng.$http $http} requests.\n *\n * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses\n * by default. See {@link $http#caching $http Caching} for more information.\n *\n * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n * setting default headers.\n * - **`defaults.headers.common`**\n * - **`defaults.headers.post`**\n * - **`defaults.headers.put`**\n * - **`defaults.headers.patch`**\n *\n * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the\n * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the\n * {@link $jsonpCallbacks} service. Defaults to `'callback'`.\n *\n * - **`defaults.paramSerializer`** - `{string|function(Object):string}` - A function\n * used to the prepare string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.\n * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.\n *\n * - **`defaults.transformRequest`** -\n * `{Array|function(data, headersGetter)}` -\n * An array of functions (or a single function) which are applied to the request data.\n * By default, this is an array with one request transformation function:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * - **`defaults.transformResponse`** -\n * `{Array|function(data, headersGetter, status)}` -\n * An array of functions (or a single function) which are applied to the response data. By default,\n * this is an array which applies one response transformation function that does two things:\n *\n * - If XSRF prefix is detected, strip it\n * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n * Defaults value is `'XSRF-TOKEN'`.\n *\n * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n *\n */\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [defaultHttpResponseTransform],\n // transform outgoing request data\n transformRequest: [function (d) {\n return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n }],\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n },\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n paramSerializer: '$httpParamSerializer',\n jsonpCallbackParam: 'callback'\n };\n var useApplyAsync = false;\n /**\n * @ngdoc method\n * @name $httpProvider#useApplyAsync\n * @description\n *\n * Configure $http service to combine processing of multiple http responses received at around\n * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n * significant performance improvement for bigger applications that make many HTTP requests\n * concurrently (common during application bootstrap).\n *\n * Defaults to false. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n * \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n * to load and share the same digest cycle.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n */\n this.useApplyAsync = function (value) {\n if (isDefined(value)) {\n useApplyAsync = !!value;\n return this;\n }\n return useApplyAsync;\n };\n\n /**\n * @ngdoc property\n * @name $httpProvider#interceptors\n * @description\n *\n * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n * pre-processing of request or postprocessing of responses.\n *\n * These service factories are ordered by request, i.e. they are applied in the same order as the\n * array, on request, but reverse order, on response.\n *\n * {@link ng.$http#interceptors Interceptors detailed info}\n */\n var interceptorFactories = this.interceptors = [];\n\n /**\n * @ngdoc property\n * @name $httpProvider#xsrfTrustedOrigins\n * @description\n *\n * Array containing URLs whose origins are trusted to receive the XSRF token. See the\n * {@link ng.$http#security-considerations Security Considerations} sections for more details on\n * XSRF.\n *\n * **Note:** An \"origin\" consists of the [URI scheme](https://en.wikipedia.org/wiki/URI_scheme),\n * the [hostname](https://en.wikipedia.org/wiki/Hostname) and the\n * [port number](https://en.wikipedia.org/wiki/Port_(computer_networking). For `http:` and\n * `https:`, the port number can be omitted if using th default ports (80 and 443 respectively).\n * Examples: `http://example.com`, `https://api.example.com:9876`\n *\n *
\n * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts\n * of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be\n * treated as `https://foo.com`, meaning that **all** requests to URLs starting with\n * `https://foo.com/` will include the XSRF token.\n *
\n *\n * @example\n *\n * ```js\n * // App served from `https://example.com/`.\n * angular.\n * module('xsrfTrustedOriginsExample', []).\n * config(['$httpProvider', function($httpProvider) {\n * $httpProvider.xsrfTrustedOrigins.push('https://api.example.com');\n * }]).\n * run(['$http', function($http) {\n * // The XSRF token will be sent.\n * $http.get('https://api.example.com/preferences').then(...);\n *\n * // The XSRF token will NOT be sent.\n * $http.get('https://stats.example.com/activity').then(...);\n * }]);\n * ```\n */\n var xsrfTrustedOrigins = this.xsrfTrustedOrigins = [];\n\n /**\n * @ngdoc property\n * @name $httpProvider#xsrfWhitelistedOrigins\n * @description\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This property is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}\n * instead.\n */\n Object.defineProperty(this, 'xsrfWhitelistedOrigins', {\n get: function () {\n return this.xsrfTrustedOrigins;\n },\n set: function (origins) {\n this.xsrfTrustedOrigins = origins;\n }\n });\n this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce', function ($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {\n var defaultCache = $cacheFactory('$http');\n\n /**\n * Make sure that default param serializer is exposed as a function\n */\n defaults.paramSerializer = isString(defaults.paramSerializer) ? $injector.get(defaults.paramSerializer) : defaults.paramSerializer;\n\n /**\n * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n * The reversal is needed so that we can build up the interception chain around the\n * server request.\n */\n var reversedInterceptors = [];\n forEach(interceptorFactories, function (interceptorFactory) {\n reversedInterceptors.unshift(isString(interceptorFactory) ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n });\n\n /**\n * A function to check request URLs against a list of allowed origins.\n */\n var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfTrustedOrigins);\n\n /**\n * @ngdoc service\n * @kind function\n * @name $http\n * @requires ng.$httpBackend\n * @requires $cacheFactory\n * @requires $rootScope\n * @requires $q\n * @requires $injector\n *\n * @description\n * The `$http` service is a core AngularJS service that facilitates communication with the remote\n * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n *\n * For unit testing applications that use `$http` service, see\n * {@link ngMock.$httpBackend $httpBackend mock}.\n *\n * For a higher level of abstraction, please check out the {@link ngResource.$resource\n * $resource} service.\n *\n * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n * it is important to familiarize yourself with these APIs and the guarantees they provide.\n *\n *\n * ## General usage\n * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —\n * that is used to generate an HTTP request and returns a {@link ng.$q promise} that is\n * resolved (request success) or rejected (request failure) with a\n * {@link ng.$http#$http-returns response} object.\n *\n * ```js\n * // Simple GET request example:\n * $http({\n * method: 'GET',\n * url: '/someUrl'\n * }).then(function successCallback(response) {\n * // this callback will be called asynchronously\n * // when the response is available\n * }, function errorCallback(response) {\n * // called asynchronously if an error occurs\n * // or server returns response with an error status.\n * });\n * ```\n *\n *\n * ## Shortcut methods\n *\n * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n * request data must be passed in for POST/PUT requests. An optional config can be passed as the\n * last argument.\n *\n * ```js\n * $http.get('/someUrl', config).then(successCallback, errorCallback);\n * $http.post('/someUrl', data, config).then(successCallback, errorCallback);\n * ```\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#get $http.get}\n * - {@link ng.$http#head $http.head}\n * - {@link ng.$http#post $http.post}\n * - {@link ng.$http#put $http.put}\n * - {@link ng.$http#delete $http.delete}\n * - {@link ng.$http#jsonp $http.jsonp}\n * - {@link ng.$http#patch $http.patch}\n *\n *\n * ## Writing Unit Tests that use $http\n * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n * request using trained responses.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $http.get(...);\n * $httpBackend.flush();\n * ```\n *\n * ## Setting HTTP Headers\n *\n * The $http service will automatically add certain HTTP headers to all requests. These defaults\n * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n * object, which currently contains this default configuration:\n *\n * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n * - Accept: application/json, text/plain, \\*/\\*\n * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n * - `Content-Type: application/json`\n * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n * - `Content-Type: application/json`\n *\n * To add or overwrite these defaults, simply add or remove a property from these configuration\n * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n * with the lowercased HTTP method name as the key, e.g.\n * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.\n *\n * The defaults can also be set at runtime via the `$http.defaults` object in the same\n * fashion. For example:\n *\n * ```\n * module.run(function($http) {\n * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';\n * });\n * ```\n *\n * In addition, you can supply a `headers` property in the config object passed when\n * calling `$http(config)`, which overrides the defaults without changing them globally.\n *\n * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n * Use the `headers` property, setting the desired header to `undefined`. For example:\n *\n * ```js\n * var req = {\n * method: 'POST',\n * url: 'http://example.com',\n * headers: {\n * 'Content-Type': undefined\n * },\n * data: { test: 'test' }\n * }\n *\n * $http(req).then(function(){...}, function(){...});\n * ```\n *\n * ## Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transformation functions: `transformRequest`\n * and `transformResponse`. These properties can be a single function that returns\n * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n *\n *
\n * **Note:** AngularJS does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline.\n * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference).\n * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest\n * function will be reflected on the scope and in any templates where the object is data-bound.\n * To prevent this, transform functions should have no side-effects.\n * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return.\n *
\n *\n * ### Default Transformations\n *\n * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n * `defaults.transformResponse` properties. If a request does not provide its own transformations\n * then these will be applied.\n *\n * You can augment or replace the default transformations by modifying these properties by adding to or\n * replacing the array.\n *\n * AngularJS provides the following default transformations:\n *\n * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is\n * an array with one function that does the following:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is\n * an array with one function that does the following:\n *\n * - If XSRF prefix is detected, strip it (see Security Considerations section below).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n *\n * ### Overriding the Default Transformations Per Request\n *\n * If you wish to override the request/response transformations only for a single request then provide\n * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n * into `$http`.\n *\n * Note that if you provide these properties on the config object the default transformations will be\n * overwritten. If you wish to augment the default transformations then you must include them in your\n * local transformation array.\n *\n * The following code demonstrates adding a new response transformation to be run after the default response\n * transformations have been run.\n *\n * ```js\n * function appendTransform(defaults, transform) {\n *\n * // We can't guarantee that the default transformation is an array\n * defaults = angular.isArray(defaults) ? defaults : [defaults];\n *\n * // Append the new transformation to the defaults\n * return defaults.concat(transform);\n * }\n *\n * $http({\n * url: '...',\n * method: 'GET',\n * transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n * return doTransform(value);\n * })\n * });\n * ```\n *\n *\n * ## Caching\n *\n * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must\n * set the config.cache value or the default cache value to TRUE or to a cache object (created\n * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes\n * precedence over the default cache value.\n *\n * In order to:\n * * cache all responses - set the default cache value to TRUE or to a cache object\n * * cache a specific response - set config.cache value to TRUE or to a cache object\n *\n * If caching is enabled, but neither the default cache nor config.cache are set to a cache object,\n * then the default `$cacheFactory(\"$http\")` object is used.\n *\n * The default cache value can be set by updating the\n * {@link ng.$http#defaults `$http.defaults.cache`} property or the\n * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property.\n *\n * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using\n * the relevant cache object. The next time the same request is made, the response is returned\n * from the cache without sending a request to the server.\n *\n * Take note that:\n *\n * * Only GET and JSONP requests are cached.\n * * The cache key is the request URL including search parameters; headers are not considered.\n * * Cached responses are returned asynchronously, in the same way as responses from the server.\n * * If multiple identical requests are made using the same cache, which is not yet populated,\n * one request will be made to the server and remaining requests will return the same response.\n * * A cache-control header on the response does not affect if or how responses are cached.\n *\n *\n * ## Interceptors\n *\n * Before you start creating interceptors, be sure to understand the\n * {@link ng.$q $q and deferred/promise APIs}.\n *\n * For purposes of global error handling, authentication, or any kind of synchronous or\n * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n * able to intercept requests before they are handed to the server and\n * responses before they are handed over to the application code that\n * initiated these requests. The interceptors leverage the {@link ng.$q\n * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n *\n * The interceptors are service factories that are registered with the `$httpProvider` by\n * adding them to the `$httpProvider.interceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor.\n *\n * There are two kinds of interceptors (and two kinds of rejection interceptors):\n *\n * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to\n * modify the `config` object or create a new one. The function needs to return the `config`\n * object directly, or a promise containing the `config` or a new `config` object.\n * * `requestError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n * * `response`: interceptors get called with http `response` object. The function is free to\n * modify the `response` object or create a new one. The function needs to return the `response`\n * object directly, or as a promise containing the `response` or a new `response` object.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * ```js\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return {\n * // optional method\n * 'request': function(config) {\n * // do something on success\n * return config;\n * },\n *\n * // optional method\n * 'requestError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * },\n *\n *\n *\n * // optional method\n * 'response': function(response) {\n * // do something on success\n * return response;\n * },\n *\n * // optional method\n * 'responseError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * }\n * };\n * });\n *\n * $httpProvider.interceptors.push('myHttpInterceptor');\n *\n *\n * // alternatively, register the interceptor via an anonymous factory\n * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n * return {\n * 'request': function(config) {\n * // same as above\n * },\n *\n * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * ```\n *\n * ## Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n *\n * Both server and the client must cooperate in order to eliminate these threats. AngularJS comes\n * pre-configured with strategies that address these issues, but for this to work backend server\n * cooperation is required.\n *\n * ### JSON Vulnerability Protection\n *\n * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * allows third party website to turn your JSON resource URL into\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n * AngularJS will automatically strip the prefix before processing it as JSON.\n *\n * For example if your server needs to return:\n * ```js\n * ['one','two']\n * ```\n *\n * which is vulnerable to attack, your server can return:\n * ```js\n * )]}',\n * ['one','two']\n * ```\n *\n * AngularJS will strip the prefix, before processing the JSON.\n *\n *\n * ### Cross Site Request Forgery (XSRF) Protection\n *\n * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by\n * which the attacker can trick an authenticated user into unknowingly executing actions on your\n * website. AngularJS provides a mechanism to counter XSRF. When performing XHR requests, the\n * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP\n * header (by default `X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read\n * the cookie, your server can be assured that the XHR came from JavaScript running on your\n * domain.\n *\n * To take advantage of this, your server needs to set a token in a JavaScript readable session\n * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n * server can verify that the cookie matches the `X-XSRF-TOKEN` HTTP header, and therefore be\n * sure that only JavaScript running on your domain could have sent the request. The token must\n * be unique for each user and must be verifiable by the server (to prevent the JavaScript from\n * making up its own tokens). We recommend that the token is a digest of your site's\n * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))\n * for added security.\n *\n * The header will — by default — **not** be set for cross-domain requests. This\n * prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining\n * access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you\n * want to, you can trust additional origins to also receive the XSRF token, by adding them\n * to {@link ng.$httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}. This might be\n * useful, for example, if your application, served from `example.com`, needs to access your API\n * at `api.example.com`.\n * See {@link ng.$httpProvider#xsrfTrustedOrigins $httpProvider.xsrfTrustedOrigins} for\n * more details.\n *\n *
\n * **Warning**
\n * Only trusted origins that you have control over and make sure you understand the\n * implications of doing so.\n *
\n *\n * The name of the cookie and the header can be specified using the `xsrfCookieName` and\n * `xsrfHeaderName` properties of either `$httpProvider.defaults` at config-time,\n * `$http.defaults` at run-time, or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple AngularJS apps share the\n * same domain or subdomain, we recommend that each application uses a unique cookie name.\n *\n *\n * @param {object} config Object describing the request to be made and how it should be\n * processed. The object has following properties:\n *\n * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n * - **url** – `{string|TrustedObject}` – Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * - **params** – `{Object.}` – Map of strings or objects which will be serialized\n * with the `paramSerializer` and appended as GET parameters.\n * - **data** – `{string|Object}` – Data to be sent as the request message data.\n * - **headers** – `{Object}` – Map of strings or functions which return strings representing\n * HTTP headers to send to the server. If the return value of a function is null, the\n * header will not be sent. Functions accept a config object as an argument.\n * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object.\n * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload\n * object. To bind events to the XMLHttpRequest object, use `eventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n * - **transformRequest** –\n * `{function(data, headersGetter)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **transformResponse** –\n * `{function(data, headersGetter, status)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **paramSerializer** - `{string|function(Object):string}` - A function used to\n * prepare the string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as function registered with the\n * {@link $injector $injector}, which means you can create your own serializer\n * by registering it as a {@link auto.$provide#service service}.\n * The default serializer is the {@link $httpParamSerializer $httpParamSerializer};\n * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}\n * - **cache** – `{boolean|Object}` – A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response.\n * See {@link $http#caching $http Caching} for more information.\n * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n * that should abort the request when resolved.\n *\n * A numerical timeout or a promise returned from {@link ng.$timeout $timeout}, will set\n * the `xhrStatus` in the {@link $http#$http-returns response} to \"timeout\", and any other\n * resolved promise will set it to \"abort\", following standard XMLHttpRequest behavior.\n *\n * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n * for more information.\n * - **responseType** - `{string}` - see\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).\n *\n * @returns {HttpPromise} A {@link ng.$q `Promise}` that will be resolved (request success)\n * or rejected (request failure) with a response object.\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with\n * the transform functions.\n * - **status** – `{number}` – HTTP status code of the response.\n * - **headers** – `{function([headerName])}` – Header getter function.\n * - **config** – `{Object}` – The configuration object that was used\n * to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest\n * (`complete`, `error`, `timeout` or `abort`).\n *\n *\n * A response status code between 200 and 299 is considered a success status\n * and will result in the success callback being called. Any response status\n * code outside of that range is considered an error status and will result\n * in the error callback being called.\n * Also, status codes less than -1 are normalized to zero. -1 usually means\n * the request was aborted, e.g. using a `config.timeout`. More information\n * about the status might be available in the `xhrStatus` property.\n *\n * Note that if the response is a redirect, XMLHttpRequest will transparently\n * follow it, meaning that the outcome (success or error) will be determined\n * by the final response status code.\n *\n *\n * @property {Array.} pendingRequests Array of config objects for currently pending\n * requests. This is primarily meant to be used for debugging purposes.\n *\n *\n * @example\n \n \n
\n \n \n
\n \n \n \n
http status code: {{status}}
\n
http response data: {{data}}
\n
\n
\n \n angular.module('httpExample', [])\n .config(['$sceDelegateProvider', function($sceDelegateProvider) {\n // We must add the JSONP endpoint that we are using to the trusted list to show that we trust it\n $sceDelegateProvider.trustedResourceUrlList([\n 'self',\n 'https://angularjs.org/**'\n ]);\n }])\n .controller('FetchController', ['$scope', '$http', '$templateCache',\n function($scope, $http, $templateCache) {\n $scope.method = 'GET';\n $scope.url = 'http-hello.html';\n $scope.fetch = function() {\n $scope.code = null;\n $scope.response = null;\n $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n then(function(response) {\n $scope.status = response.status;\n $scope.data = response.data;\n }, function(response) {\n $scope.data = response.data || 'Request failed';\n $scope.status = response.status;\n });\n };\n $scope.updateModel = function(method, url) {\n $scope.method = method;\n $scope.url = url;\n };\n }]);\n \n \n Hello, $http!\n \n \n var status = element(by.binding('status'));\n var data = element(by.binding('data'));\n var fetchBtn = element(by.id('fetchbtn'));\n var sampleGetBtn = element(by.id('samplegetbtn'));\n var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n it('should make an xhr GET request', function() {\n sampleGetBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('200');\n expect(data.getText()).toMatch(/Hello, \\$http!/);\n });\n // Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n // it('should make a JSONP request to angularjs.org', function() {\n // var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n // sampleJsonpBtn.click();\n // fetchBtn.click();\n // expect(status.getText()).toMatch('200');\n // expect(data.getText()).toMatch(/Super Hero!/);\n // });\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n invalidJsonpBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('0');\n expect(data.getText()).toMatch('Request failed');\n });\n \n
\n */\n function $http(requestConfig) {\n if (!isObject(requestConfig)) {\n throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);\n }\n if (!isString($sce.valueOf(requestConfig.url))) {\n throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url);\n }\n var config = extend({\n method: 'get',\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n paramSerializer: defaults.paramSerializer,\n jsonpCallbackParam: defaults.jsonpCallbackParam\n }, requestConfig);\n config.headers = mergeHeaders(requestConfig);\n config.method = uppercase(config.method);\n config.paramSerializer = isString(config.paramSerializer) ? $injector.get(config.paramSerializer) : config.paramSerializer;\n $browser.$$incOutstandingRequestCount('$http');\n var requestInterceptors = [];\n var responseInterceptors = [];\n var promise = $q.resolve(config);\n\n // apply interceptors\n forEach(reversedInterceptors, function (interceptor) {\n if (interceptor.request || interceptor.requestError) {\n requestInterceptors.unshift(interceptor.request, interceptor.requestError);\n }\n if (interceptor.response || interceptor.responseError) {\n responseInterceptors.push(interceptor.response, interceptor.responseError);\n }\n });\n promise = chainInterceptors(promise, requestInterceptors);\n promise = promise.then(serverRequest);\n promise = chainInterceptors(promise, responseInterceptors);\n promise = promise.finally(completeOutstandingRequest);\n return promise;\n function chainInterceptors(promise, interceptors) {\n for (var i = 0, ii = interceptors.length; i < ii;) {\n var thenFn = interceptors[i++];\n var rejectFn = interceptors[i++];\n promise = promise.then(thenFn, rejectFn);\n }\n interceptors.length = 0;\n return promise;\n }\n function completeOutstandingRequest() {\n $browser.$$completeOutstandingRequest(noop, '$http');\n }\n function executeHeaderFns(headers, config) {\n var headerContent,\n processedHeaders = {};\n forEach(headers, function (headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn(config);\n if (headerContent != null) {\n processedHeaders[header] = headerContent;\n }\n } else {\n processedHeaders[header] = headerFn;\n }\n });\n return processedHeaders;\n }\n function mergeHeaders(config) {\n var defHeaders = defaults.headers,\n reqHeaders = extend({}, config.headers),\n defHeaderName,\n lowercaseDefHeaderName,\n reqHeaderName;\n defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n // using for-in instead of forEach to avoid unnecessary iteration after header has been found\n defaultHeadersIteration: for (defHeaderName in defHeaders) {\n lowercaseDefHeaderName = lowercase(defHeaderName);\n for (reqHeaderName in reqHeaders) {\n if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n continue defaultHeadersIteration;\n }\n }\n reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n }\n\n // execute if header value is a function for merged headers\n return executeHeaderFns(reqHeaders, shallowCopy(config));\n }\n function serverRequest(config) {\n var headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(reqData)) {\n forEach(headers, function (value, header) {\n if (lowercase(header) === 'content-type') {\n delete headers[header];\n }\n });\n }\n if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n config.withCredentials = defaults.withCredentials;\n }\n\n // send request\n return sendReq(config, reqData).then(transformResponse, transformResponse);\n }\n function transformResponse(response) {\n // make a copy since the response must be cacheable\n var resp = extend({}, response);\n resp.data = transformData(response.data, response.headers, response.status, config.transformResponse);\n return isSuccess(response.status) ? resp : $q.reject(resp);\n }\n }\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name $http#get\n *\n * @description\n * Shortcut method to perform `GET` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#delete\n *\n * @description\n * Shortcut method to perform `DELETE` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#head\n *\n * @description\n * Shortcut method to perform `HEAD` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#jsonp\n *\n * @description\n * Shortcut method to perform `JSONP` request.\n *\n * Note that, since JSONP requests are sensitive because the response is given full access to the browser,\n * the url must be declared, via {@link $sce} as a trusted resource URL.\n * You can trust a URL by adding it to the trusted resource URL list via\n * {@link $sceDelegateProvider#trustedResourceUrlList `$sceDelegateProvider.trustedResourceUrlList`} or\n * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}.\n *\n * You should avoid generating the URL for the JSONP request from user provided data.\n * Provide additional query parameters via `params` property of the `config` parameter, rather than\n * modifying the URL itself.\n *\n * JSONP requests must specify a callback to be used in the response from the server. This callback\n * is passed as a query parameter in the request. You must specify the name of this parameter by\n * setting the `jsonpCallbackParam` property on the request config object.\n *\n * ```\n * $http.jsonp('some/trusted/url', {jsonpCallbackParam: 'callback'})\n * ```\n *\n * You can also specify a default callback parameter name in `$http.defaults.jsonpCallbackParam`.\n * Initially this is set to `'callback'`.\n *\n *
\n * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback\n * parameter value should go.\n *
\n *\n * If you would like to customise where and how the callbacks are stored then try overriding\n * or decorating the {@link $jsonpCallbacks} service.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n createShortMethods('get', 'delete', 'head', 'jsonp');\n\n /**\n * @ngdoc method\n * @name $http#post\n *\n * @description\n * Shortcut method to perform `POST` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#put\n *\n * @description\n * Shortcut method to perform `PUT` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#patch\n *\n * @description\n * Shortcut method to perform `PATCH` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n createShortMethodsWithData('post', 'put', 'patch');\n\n /**\n * @ngdoc property\n * @name $http#defaults\n *\n * @description\n * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n * default headers, withCredentials as well as request and response transformations.\n *\n * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n */\n $http.defaults = defaults;\n return $http;\n function createShortMethods(names) {\n forEach(arguments, function (name) {\n $http[name] = function (url, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url\n }));\n };\n });\n }\n function createShortMethodsWithData(name) {\n forEach(arguments, function (name) {\n $http[name] = function (url, data, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url,\n data: data\n }));\n };\n });\n }\n\n /**\n * Makes the request.\n *\n * !!! ACCESSES CLOSURE VARS:\n * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n */\n function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n url = buildUrl(url, config.paramSerializer(config.params));\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n if ((config.cache || defaults.cache) && config.cache !== false && (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache : isObject( /** @type {?} */defaults.cache) ? /** @type {?} */defaults.cache : defaultCache;\n }\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url) ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName] : undefined;\n if (xsrfValue) {\n reqHeaders[config.xsrfHeaderName || defaults.xsrfHeaderName] = xsrfValue;\n }\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout, config.withCredentials, config.responseType, createApplyHandlers(config.eventHandlers), createApplyHandlers(config.uploadEventHandlers));\n }\n return promise;\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function (eventHandler, key) {\n applyHandlers[key] = function (event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }\n function buildUrl(url, serializedParams) {\n if (serializedParams.length > 0) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n return url;\n }\n function sanitizeJsonpCallbackParam(url, cbKey) {\n var parts = url.split('?');\n if (parts.length > 2) {\n // Throw if the url contains more than one `?` query indicator\n throw $httpMinErr('badjsonp', 'Illegal use more than one \"?\", in url, \"{1}\"', url);\n }\n var params = parseKeyValue(parts[1]);\n forEach(params, function (value, key) {\n if (value === 'JSON_CALLBACK') {\n // Throw if the url already contains a reference to JSON_CALLBACK\n throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, \"{0}\"', url);\n }\n if (key === cbKey) {\n // Throw if the callback param was already provided\n throw $httpMinErr('badjsonp', 'Illegal use of callback param, \"{0}\", in url, \"{1}\"', cbKey, url);\n }\n });\n\n // Add in the JSON_CALLBACK callback param value\n url += (url.indexOf('?') === -1 ? '?' : '&') + cbKey + '=JSON_CALLBACK';\n return url;\n }\n }];\n }\n\n /**\n * @ngdoc service\n * @name $xhrFactory\n * @this\n *\n * @description\n * Factory function used to create XMLHttpRequest objects.\n *\n * Replace or decorate this service to create your own custom XMLHttpRequest objects.\n *\n * ```\n * angular.module('myApp', [])\n * .factory('$xhrFactory', function() {\n * return function createXhr(method, url) {\n * return new window.XMLHttpRequest({mozSystem: true});\n * };\n * });\n * ```\n *\n * @param {string} method HTTP method of the request (GET, POST, PUT, ..)\n * @param {string} url URL of the request.\n */\n function $xhrFactoryProvider() {\n this.$get = function () {\n return function createXhr() {\n return new window.XMLHttpRequest();\n };\n };\n }\n\n /**\n * @ngdoc service\n * @name $httpBackend\n * @requires $jsonpCallbacks\n * @requires $document\n * @requires $xhrFactory\n * @this\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\n function $HttpBackendProvider() {\n this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function ($browser, $jsonpCallbacks, $document, $xhrFactory) {\n return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);\n }];\n }\n function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n // TODO(vojta): fix the signature\n return function (method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n url = url || $browser.url();\n if (lowercase(method) === 'jsonp') {\n var callbackPath = callbacks.createCallback(url);\n var jsonpDone = jsonpReq(url, callbackPath, function (status, text) {\n // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING)\n var response = status === 200 && callbacks.getResponse(callbackPath);\n completeRequest(callback, status, response, '', text, 'complete');\n callbacks.removeCallback(callbackPath);\n });\n } else {\n var xhr = createXhr(method, url);\n var abortedByTimeout = false;\n xhr.open(method, url, true);\n forEach(headers, function (value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n var response = 'response' in xhr ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0;\n }\n completeRequest(callback, status, response, xhr.getAllResponseHeaders(), statusText, 'complete');\n };\n var requestError = function () {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'error');\n };\n var requestAborted = function () {\n completeRequest(callback, -1, null, null, '', abortedByTimeout ? 'timeout' : 'abort');\n };\n var requestTimeout = function () {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'timeout');\n };\n xhr.onerror = requestError;\n xhr.ontimeout = requestTimeout;\n xhr.onabort = requestAborted;\n forEach(eventHandlers, function (value, key) {\n xhr.addEventListener(key, value);\n });\n forEach(uploadEventHandlers, function (value, key) {\n xhr.upload.addEventListener(key, value);\n });\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n if (responseType) {\n try {\n xhr.responseType = responseType;\n } catch (e) {\n // WebKit added support for the json responseType value on 09/03/2013\n // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n // known to throw when setting the value \"json\" as the response type. Other older\n // browsers implementing the responseType\n //\n // The json response type can be ignored if not supported, because JSON payloads are\n // parsed on the client-side regardless.\n if (responseType !== 'json') {\n throw e;\n }\n }\n }\n xhr.send(isUndefined(post) ? null : post);\n }\n\n // Since we are using xhr.abort() when a request times out, we have to set a flag that\n // indicates to requestAborted if the request timed out or was aborted.\n //\n // http.timeout = numerical timeout timeout\n // http.timeout = $timeout timeout\n // http.timeout = promise abort\n // xhr.abort() abort (The xhr object is normally inaccessible, but\n // can be exposed with the xhrFactory)\n if (timeout > 0) {\n var timeoutId = $browserDefer(function () {\n timeoutRequest('timeout');\n }, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(function () {\n timeoutRequest(isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');\n });\n }\n function timeoutRequest(reason) {\n abortedByTimeout = reason === 'timeout';\n if (jsonpDone) {\n jsonpDone();\n }\n if (xhr) {\n xhr.abort();\n }\n }\n function completeRequest(callback, status, response, headersString, statusText, xhrStatus) {\n // cancel timeout and subsequent timeout promise resolution\n if (isDefined(timeoutId)) {\n $browserDefer.cancel(timeoutId);\n }\n jsonpDone = xhr = null;\n callback(status, response, headersString, statusText, xhrStatus);\n }\n };\n function jsonpReq(url, callbackPath, done) {\n url = url.replace('JSON_CALLBACK', callbackPath);\n // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:\n // - fetches local scripts via XHR and evals them\n // - adds and immediately removes script elements from the document\n var script = rawDocument.createElement('script'),\n callback = null;\n script.type = 'text/javascript';\n script.src = url;\n script.async = true;\n callback = function (event) {\n script.removeEventListener('load', callback);\n script.removeEventListener('error', callback);\n rawDocument.body.removeChild(script);\n script = null;\n var status = -1;\n var text = 'unknown';\n if (event) {\n if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) {\n event = {\n type: 'error'\n };\n }\n text = event.type;\n status = event.type === 'error' ? 404 : 200;\n }\n if (done) {\n done(status, text);\n }\n };\n script.addEventListener('load', callback);\n script.addEventListener('error', callback);\n rawDocument.body.appendChild(script);\n return callback;\n }\n }\n var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');\n $interpolateMinErr.throwNoconcat = function (text) {\n throw $interpolateMinErr('noconcat', 'Error while interpolating: {0}\\nStrict Contextual Escaping disallows ' + 'interpolations that concatenate multiple expressions when a trusted value is ' + 'required. See http://docs.angularjs.org/api/ng.$sce', text);\n };\n $interpolateMinErr.interr = function (text, err) {\n return $interpolateMinErr('interr', 'Can\\'t interpolate: {0}\\n{1}', text, err.toString());\n };\n\n /**\n * @ngdoc provider\n * @name $interpolateProvider\n * @this\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n *
\n * This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS\n * template within a Python Jinja template (or any other template language). Mixing templating\n * languages is **very dangerous**. The embedding template language will not safely escape AngularJS\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n *
\n *\n * @example\n \n \n \n
\n //demo.label//\n
\n
\n \n it('should interpolate binding with custom symbols', function() {\n expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n });\n \n
\n */\n function $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#startSymbol\n * @description\n * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n *\n * @param {string=} value new value to set the starting symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.startSymbol = function (value) {\n if (value) {\n startSymbol = value;\n return this;\n }\n return startSymbol;\n };\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * @param {string=} value new value to set the ending symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.endSymbol = function (value) {\n if (value) {\n endSymbol = value;\n return this;\n }\n return endSymbol;\n };\n this.$get = ['$parse', '$exceptionHandler', '$sce', function ($parse, $exceptionHandler, $sce) {\n var startSymbolLength = startSymbol.length,\n endSymbolLength = endSymbol.length,\n escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n function escape(ch) {\n return '\\\\\\\\\\\\' + ch;\n }\n function unescapeText(text) {\n return text.replace(escapedStartRegexp, startSymbol).replace(escapedEndRegexp, endSymbol);\n }\n\n // TODO: this is the same as the constantWatchDelegate in parse.js\n function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n\n /**\n * @ngdoc service\n * @name $interpolate\n * @kind function\n *\n * @requires $parse\n * @requires $sce\n *\n * @description\n *\n * Compiles a string with markup into an interpolation function. This service is used by the\n * HTML {@link ng.$compile $compile} service for data binding. See\n * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n * interpolation markup.\n *\n *\n * ```js\n * var $interpolate = ...; // injected\n * var exp = $interpolate('Hello {{name | uppercase}}!');\n * expect(exp({name:'AngularJS'})).toEqual('Hello ANGULARJS!');\n * ```\n *\n * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n * `true`, the interpolation function will return `undefined` unless all embedded expressions\n * evaluate to a value other than `undefined`.\n *\n * ```js\n * var $interpolate = ...; // injected\n * var context = {greeting: 'Hello', name: undefined };\n *\n * // default \"forgiving\" mode\n * var exp = $interpolate('{{greeting}} {{name}}!');\n * expect(exp(context)).toEqual('Hello !');\n *\n * // \"allOrNothing\" mode\n * exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n * expect(exp(context)).toBeUndefined();\n * context.name = 'AngularJS';\n * expect(exp(context)).toEqual('Hello AngularJS!');\n * ```\n *\n * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n *\n * #### Escaped Interpolation\n * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n * or binding.\n *\n * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n * degree, while also enabling code examples to work without relying on the\n * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n *\n * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all\n * interpolation start/end markers with their escaped counterparts.**\n *\n * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n * output when the $interpolate service processes the text. So, for HTML elements interpolated\n * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n * this is typically useful only when user-data is used in rendering a template from the server, or\n * when otherwise untrusted data is used by a directive.\n *\n * \n * \n *
\n *

{{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n *

\n *

{{username}} attempts to inject code which will deface the\n * application, but fails to accomplish their task, because the server has correctly\n * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n * characters.

\n *

Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.

\n *
\n *
\n *
\n *\n * @knownIssue\n * It is currently not possible for an interpolated expression to contain the interpolation end\n * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e.\n * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string.\n *\n * @knownIssue\n * All directives and components must use the standard `{{` `}}` interpolation symbols\n * in their templates. If you change the application interpolation symbols the {@link $compile}\n * service will attempt to denormalize the standard symbols to the custom symbols.\n * The denormalization process is not clever enough to know not to replace instances of the standard\n * symbols where they would not normally be treated as interpolation symbols. For example in the following\n * code snippet the closing braces of the literal object will get incorrectly denormalized:\n *\n * ```\n *
\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information.\n *\n * @param {string} text The text with markup to interpolate.\n * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n * embedded expression in order to return an interpolation function. Strings with no\n * embedded expression will return null for the interpolation function.\n * @param {string=} trustedContext when provided, the returned function passes the interpolated\n * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that\n * provides Strict Contextual Escaping for details.\n * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n * unless all embedded expressions evaluate to a value other than `undefined`.\n * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * - `context`: evaluation context for all expressions embedded in the interpolated text\n */\n function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n var contextAllowsConcatenation = trustedContext === $sce.URL || trustedContext === $sce.MEDIA_URL;\n\n // Provide a quick exit and simplified result function for text with no interpolation\n if (!text.length || text.indexOf(startSymbol) === -1) {\n if (mustHaveExpression) return;\n var unescapedText = unescapeText(text);\n if (contextAllowsConcatenation) {\n unescapedText = $sce.getTrusted(trustedContext, unescapedText);\n }\n var constantInterp = valueFn(unescapedText);\n constantInterp.exp = text;\n constantInterp.expressions = [];\n constantInterp.$$watchDelegate = constantWatchDelegate;\n return constantInterp;\n }\n allOrNothing = !!allOrNothing;\n var startIndex,\n endIndex,\n index = 0,\n expressions = [],\n parseFns,\n textLength = text.length,\n exp,\n concat = [],\n expressionPositions = [],\n singleExpression;\n while (index < textLength) {\n if ((startIndex = text.indexOf(startSymbol, index)) !== -1 && (endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1) {\n if (index !== startIndex) {\n concat.push(unescapeText(text.substring(index, startIndex)));\n }\n exp = text.substring(startIndex + startSymbolLength, endIndex);\n expressions.push(exp);\n index = endIndex + endSymbolLength;\n expressionPositions.push(concat.length);\n concat.push(''); // Placeholder that will get replaced with the evaluated expression.\n } else {\n // we did not find an interpolation, so we have to add the remainder to the separators array\n if (index !== textLength) {\n concat.push(unescapeText(text.substring(index)));\n }\n break;\n }\n }\n singleExpression = concat.length === 1 && expressionPositions.length === 1;\n // Intercept expression if we need to stringify concatenated inputs, which may be SCE trusted\n // objects rather than simple strings\n // (we don't modify the expression if the input consists of only a single trusted input)\n var interceptor = contextAllowsConcatenation && singleExpression ? undefined : parseStringifyInterceptor;\n parseFns = expressions.map(function (exp) {\n return $parse(exp, interceptor);\n });\n\n // Concatenating expressions makes it hard to reason about whether some combination of\n // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a\n // single expression be used for some $sce-managed secure contexts (RESOURCE_URLs mostly),\n // we ensure that the value that's used is assigned or constructed by some JS code somewhere\n // that is more testable or make it obvious that you bound the value to some user controlled\n // value. This helps reduce the load when auditing for XSS issues.\n\n // Note that URL and MEDIA_URL $sce contexts do not need this, since `$sce` can sanitize the values\n // passed to it. In that case, `$sce.getTrusted` will be called on either the single expression\n // or on the overall concatenated string (losing trusted types used in the mix, by design).\n // Both these methods will sanitize plain strings. Also, HTML could be included, but since it's\n // only used in srcdoc attributes, this would not be very useful.\n\n if (!mustHaveExpression || expressions.length) {\n var compute = function (values) {\n for (var i = 0, ii = expressions.length; i < ii; i++) {\n if (allOrNothing && isUndefined(values[i])) return;\n concat[expressionPositions[i]] = values[i];\n }\n if (contextAllowsConcatenation) {\n // If `singleExpression` then `concat[0]` might be a \"trusted\" value or `null`, rather than a string\n return $sce.getTrusted(trustedContext, singleExpression ? concat[0] : concat.join(''));\n } else if (trustedContext && concat.length > 1) {\n // This context does not allow more than one part, e.g. expr + string or exp + exp.\n $interpolateMinErr.throwNoconcat(text);\n }\n // In an unprivileged context or only one part: just concatenate and return.\n return concat.join('');\n };\n return extend(function interpolationFn(context) {\n var i = 0;\n var ii = expressions.length;\n var values = new Array(ii);\n try {\n for (; i < ii; i++) {\n values[i] = parseFns[i](context);\n }\n return compute(values);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }, {\n // all of these properties are undocumented for now\n exp: text,\n //just for compatibility with regular watchers created via $watch\n expressions: expressions,\n $$watchDelegate: function (scope, listener) {\n var lastValue;\n return scope.$watchGroup(parseFns, /** @this */function interpolateFnWatcher(values, oldValues) {\n var currValue = compute(values);\n listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n lastValue = currValue;\n });\n }\n });\n }\n function parseStringifyInterceptor(value) {\n try {\n // In concatenable contexts, getTrusted comes at the end, to avoid sanitizing individual\n // parts of a full URL. We don't care about losing the trustedness here.\n // In non-concatenable contexts, where there is only one expression, this interceptor is\n // not applied to the expression.\n value = trustedContext && !contextAllowsConcatenation ? $sce.getTrusted(trustedContext, value) : $sce.valueOf(value);\n return allOrNothing && !isDefined(value) ? value : stringify(value);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }\n }\n\n /**\n * @ngdoc method\n * @name $interpolate#startSymbol\n * @description\n * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n *\n * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n * the symbol.\n *\n * @returns {string} start symbol.\n */\n $interpolate.startSymbol = function () {\n return startSymbol;\n };\n\n /**\n * @ngdoc method\n * @name $interpolate#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n * the symbol.\n *\n * @returns {string} end symbol.\n */\n $interpolate.endSymbol = function () {\n return endSymbol;\n };\n return $interpolate;\n }];\n }\n var $intervalMinErr = minErr('$interval');\n\n /** @this */\n function $IntervalProvider() {\n this.$get = ['$$intervalFactory', '$window', function ($$intervalFactory, $window) {\n var intervals = {};\n var setIntervalFn = function (tick, delay, deferred) {\n var id = $window.setInterval(tick, delay);\n intervals[id] = deferred;\n return id;\n };\n var clearIntervalFn = function (id) {\n $window.clearInterval(id);\n delete intervals[id];\n };\n\n /**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n * milliseconds.\n *\n * The return value of registering an interval function is a promise. This promise will be\n * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n * run indefinitely if `count` is not defined. The value of the notification will be the\n * number of iterations that have run.\n * To cancel an interval, call `$interval.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n *
\n * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n * with them. In particular they are not automatically destroyed when a controller's scope or a\n * directive's element are destroyed.\n * You should take this into consideration and make sure to always cancel the interval at the\n * appropriate moment. See the example below for more details on how and when to do this.\n *
\n *\n * @param {function()} fn A function that should be called repeatedly. If no additional arguments\n * are passed (see below), the function is called with the current iteration count.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete.\n *\n * @example\n * \n * \n * \n *\n *
\n *
\n *
\n * Current time is: \n *
\n * Blood 1 : {{blood_1}}\n * Blood 2 : {{blood_2}}\n * \n * \n * \n *
\n *
\n *\n *
\n *
\n */\n var interval = $$intervalFactory(setIntervalFn, clearIntervalFn);\n\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {Promise=} promise returned by the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully canceled.\n */\n interval.cancel = function (promise) {\n if (!promise) return false;\n if (!promise.hasOwnProperty('$$intervalId')) {\n throw $intervalMinErr('badprom', '`$interval.cancel()` called with a promise that was not generated by `$interval()`.');\n }\n if (!intervals.hasOwnProperty(promise.$$intervalId)) return false;\n var id = promise.$$intervalId;\n var deferred = intervals[id];\n\n // Interval cancels should not report an unhandled promise.\n markQExceptionHandled(deferred.promise);\n deferred.reject('canceled');\n clearIntervalFn(id);\n return true;\n };\n return interval;\n }];\n }\n\n /** @this */\n function $$IntervalFactoryProvider() {\n this.$get = ['$browser', '$q', '$$q', '$rootScope', function ($browser, $q, $$q, $rootScope) {\n return function intervalFactory(setIntervalFn, clearIntervalFn) {\n return function intervalFn(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? sliceArgs(arguments, 4) : [],\n iteration = 0,\n skipApply = isDefined(invokeApply) && !invokeApply,\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n count = isDefined(count) ? count : 0;\n function callback() {\n if (!hasParams) {\n fn(iteration);\n } else {\n fn.apply(null, args);\n }\n }\n function tick() {\n if (skipApply) {\n $browser.defer(callback);\n } else {\n $rootScope.$evalAsync(callback);\n }\n deferred.notify(iteration++);\n if (count > 0 && iteration >= count) {\n deferred.resolve(iteration);\n clearIntervalFn(promise.$$intervalId);\n }\n if (!skipApply) $rootScope.$apply();\n }\n promise.$$intervalId = setIntervalFn(tick, delay, deferred, skipApply);\n return promise;\n };\n };\n }];\n }\n\n /**\n * @ngdoc service\n * @name $jsonpCallbacks\n * @requires $window\n * @description\n * This service handles the lifecycle of callbacks to handle JSONP requests.\n * Override this service if you wish to customise where the callbacks are stored and\n * how they vary compared to the requested url.\n */\n var $jsonpCallbacksProvider = /** @this */function () {\n this.$get = function () {\n var callbacks = angular.callbacks;\n var callbackMap = {};\n function createCallback(callbackId) {\n var callback = function (data) {\n callback.data = data;\n callback.called = true;\n };\n callback.id = callbackId;\n return callback;\n }\n return {\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#createCallback\n * @param {string} url the url of the JSONP request\n * @returns {string} the callback path to send to the server as part of the JSONP request\n * @description\n * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback\n * to pass to the server, which will be used to call the callback with its payload in the JSONP response.\n */\n createCallback: function (url) {\n var callbackId = '_' + (callbacks.$$counter++).toString(36);\n var callbackPath = 'angular.callbacks.' + callbackId;\n var callback = createCallback(callbackId);\n callbackMap[callbackPath] = callbacks[callbackId] = callback;\n return callbackPath;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#wasCalled\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {boolean} whether the callback has been called, as a result of the JSONP response\n * @description\n * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the\n * callback that was passed in the request.\n */\n wasCalled: function (callbackPath) {\n return callbackMap[callbackPath].called;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#getResponse\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {*} the data received from the response via the registered callback\n * @description\n * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback\n * in the JSONP response.\n */\n getResponse: function (callbackPath) {\n return callbackMap[callbackPath].data;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#removeCallback\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @description\n * {@link $httpBackend} calls this method to remove the callback after the JSONP request has\n * completed or timed-out.\n */\n removeCallback: function (callbackPath) {\n var callback = callbackMap[callbackPath];\n delete callbacks[callback.id];\n delete callbackMap[callbackPath];\n }\n };\n };\n };\n\n /**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various AngularJS components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\n\n /* global stripHash: true */\n\n var PATH_MATCH = /^([^?#]*)(\\?([^#]*))?(#(.*))?$/,\n DEFAULT_PORTS = {\n 'http': 80,\n 'https': 443,\n 'ftp': 21\n };\n var $locationMinErr = minErr('$location');\n\n /**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\n function encodePath(path) {\n var segments = path.split('/'),\n i = segments.length;\n while (i--) {\n // decode forward slashes to prevent them from being double encoded\n segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/'));\n }\n return segments.join('/');\n }\n function decodePath(path, html5Mode) {\n var segments = path.split('/'),\n i = segments.length;\n while (i--) {\n segments[i] = decodeURIComponent(segments[i]);\n if (html5Mode) {\n // encode forward slashes to prevent them from being mistaken for path separators\n segments[i] = segments[i].replace(/\\//g, '%2F');\n }\n }\n return segments.join('/');\n }\n function normalizePath(pathValue, searchValue, hashValue) {\n var search = toKeyValue(searchValue),\n hash = hashValue ? '#' + encodeUriSegment(hashValue) : '',\n path = encodePath(pathValue);\n return path + (search ? '?' + search : '') + hash;\n }\n function parseAbsoluteUrl(absoluteUrl, locationObj) {\n var parsedUrl = urlResolve(absoluteUrl);\n locationObj.$$protocol = parsedUrl.protocol;\n locationObj.$$host = parsedUrl.hostname;\n locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n }\n var DOUBLE_SLASH_REGEX = /^\\s*[\\\\/]{2,}/;\n function parseAppUrl(url, locationObj, html5Mode) {\n if (DOUBLE_SLASH_REGEX.test(url)) {\n throw $locationMinErr('badpath', 'Invalid url \"{0}\".', url);\n }\n var prefixed = url.charAt(0) !== '/';\n if (prefixed) {\n url = '/' + url;\n }\n var match = urlResolve(url);\n var path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname;\n locationObj.$$path = decodePath(path, html5Mode);\n locationObj.$$search = parseKeyValue(match.search);\n locationObj.$$hash = decodeURIComponent(match.hash);\n\n // make sure path starts with '/';\n if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') {\n locationObj.$$path = '/' + locationObj.$$path;\n }\n }\n function startsWith(str, search) {\n return str.slice(0, search.length) === search;\n }\n\n /**\n *\n * @param {string} base\n * @param {string} url\n * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with\n * the expected string.\n */\n function stripBaseUrl(base, url) {\n if (startsWith(url, base)) {\n return url.substr(base.length);\n }\n }\n function stripHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? url : url.substr(0, index);\n }\n function stripFile(url) {\n return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n }\n\n /* return the server only (scheme://host:port) */\n function serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n }\n\n /**\n * LocationHtml5Url represents a URL\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} basePrefix URL path prefix\n */\n function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {\n this.$$html5 = true;\n basePrefix = basePrefix || '';\n parseAbsoluteUrl(appBase, this);\n\n /**\n * Parse given HTML5 (regular) URL string into properties\n * @param {string} url HTML5 URL\n * @private\n */\n this.$$parse = function (url) {\n var pathUrl = stripBaseUrl(appBaseNoFile, url);\n if (!isString(pathUrl)) {\n throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url, appBaseNoFile);\n }\n parseAppUrl(pathUrl, this, true);\n if (!this.$$path) {\n this.$$path = '/';\n }\n this.$$compose();\n };\n this.$$normalizeUrl = function (url) {\n return appBaseNoFile + url.substr(1); // first char is always '/'\n };\n this.$$parseLinkUrl = function (url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var appUrl, prevAppUrl;\n var rewrittenUrl;\n if (isDefined(appUrl = stripBaseUrl(appBase, url))) {\n prevAppUrl = appUrl;\n if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) {\n rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl);\n } else {\n rewrittenUrl = appBase + prevAppUrl;\n }\n } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBaseNoFile + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n }\n\n /**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\n function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {\n parseAbsoluteUrl(appBase, this);\n\n /**\n * Parse given hashbang URL into properties\n * @param {string} url Hashbang URL\n * @private\n */\n this.$$parse = function (url) {\n var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url);\n var withoutHashUrl;\n if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {\n // The rest of the URL starts with a hash so we have\n // got either a hashbang path or a plain hash fragment\n withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl);\n if (isUndefined(withoutHashUrl)) {\n // There was no hashbang prefix so we just have a hash fragment\n withoutHashUrl = withoutBaseUrl;\n }\n } else {\n // There was no hashbang path nor hash fragment:\n // If we are in HTML5 mode we use what is left as the path;\n // Otherwise we ignore what is left\n if (this.$$html5) {\n withoutHashUrl = withoutBaseUrl;\n } else {\n withoutHashUrl = '';\n if (isUndefined(withoutBaseUrl)) {\n appBase = url;\n /** @type {?} */\n this.replace();\n }\n }\n }\n parseAppUrl(withoutHashUrl, this, false);\n this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n this.$$compose();\n\n /*\n * In Windows, on an anchor node on documents loaded from\n * the filesystem, the browser will return a pathname\n * prefixed with the drive name ('/C:/path') when a\n * pathname without a drive is set:\n * * a.setAttribute('href', '/foo')\n * * a.pathname === '/C:/foo' //true\n *\n * Inside of AngularJS, we're always using pathnames that\n * do not include drive names for routing.\n */\n function removeWindowsDriveName(path, url, base) {\n /*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\n var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n var firstPathSegmentMatch;\n\n //Get the relative path from the input URL.\n if (startsWith(url, base)) {\n url = url.replace(base, '');\n }\n\n // The input URL intentionally contains a first path segment that ends with a colon.\n if (windowsFilePathExp.exec(url)) {\n return path;\n }\n firstPathSegmentMatch = windowsFilePathExp.exec(path);\n return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n }\n };\n this.$$normalizeUrl = function (url) {\n return appBase + (url ? hashPrefix + url : '');\n };\n this.$$parseLinkUrl = function (url, relHref) {\n if (stripHash(appBase) === stripHash(url)) {\n this.$$parse(url);\n return true;\n }\n return false;\n };\n }\n\n /**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\n function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {\n this.$$html5 = true;\n LocationHashbangUrl.apply(this, arguments);\n this.$$parseLinkUrl = function (url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var rewrittenUrl;\n var appUrl;\n if (appBase === stripHash(url)) {\n rewrittenUrl = url;\n } else if (appUrl = stripBaseUrl(appBaseNoFile, url)) {\n rewrittenUrl = appBase + hashPrefix + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n this.$$normalizeUrl = function (url) {\n // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'\n return appBase + hashPrefix + url;\n };\n }\n var locationPrototype = {\n /**\n * Ensure absolute URL is initialized.\n * @private\n */\n $$absUrl: '',\n /**\n * Are we in html5 mode?\n * @private\n */\n $$html5: false,\n /**\n * Has any change been replacing?\n * @private\n */\n $$replace: false,\n /**\n * Compose url and update `url` and `absUrl` property\n * @private\n */\n $$compose: function () {\n this.$$url = normalizePath(this.$$path, this.$$search, this.$$hash);\n this.$$absUrl = this.$$normalizeUrl(this.$$url);\n this.$$urlUpdatedByLocation = true;\n },\n /**\n * @ngdoc method\n * @name $location#absUrl\n *\n * @description\n * This method is getter only.\n *\n * Return full URL representation with all segments encoded according to rules specified in\n * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var absUrl = $location.absUrl();\n * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @return {string} full URL\n */\n absUrl: locationGetter('$$absUrl'),\n /**\n * @ngdoc method\n * @name $location#url\n *\n * @description\n * This method is getter / setter.\n *\n * Return URL (e.g. `/path?a=b#hash`) when called without any parameter.\n *\n * Change path, search and hash, when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var url = $location.url();\n * // => \"/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`)\n * @return {string} url\n */\n url: function (url) {\n if (isUndefined(url)) {\n return this.$$url;\n }\n var match = PATH_MATCH.exec(url);\n if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1] || url === '') this.search(match[3] || '');\n this.hash(match[5] || '');\n return this;\n },\n /**\n * @ngdoc method\n * @name $location#protocol\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var protocol = $location.protocol();\n * // => \"http\"\n * ```\n *\n * @return {string} protocol of current URL\n */\n protocol: locationGetter('$$protocol'),\n /**\n * @ngdoc method\n * @name $location#host\n *\n * @description\n * This method is getter only.\n *\n * Return host of current URL.\n *\n * Note: compared to the non-AngularJS version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var host = $location.host();\n * // => \"example.com\"\n *\n * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo\n * host = $location.host();\n * // => \"example.com\"\n * host = location.host;\n * // => \"example.com:8080\"\n * ```\n *\n * @return {string} host of current URL.\n */\n host: locationGetter('$$host'),\n /**\n * @ngdoc method\n * @name $location#port\n *\n * @description\n * This method is getter only.\n *\n * Return port of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var port = $location.port();\n * // => 80\n * ```\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n /**\n * @ngdoc method\n * @name $location#path\n *\n * @description\n * This method is getter / setter.\n *\n * Return path of current URL when called without any parameter.\n *\n * Change path when called with parameter and return `$location`.\n *\n * Note: Path should always begin with forward slash (/), this method will add the forward slash\n * if it is missing.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var path = $location.path();\n * // => \"/some/path\"\n * ```\n *\n * @param {(string|number)=} path New path\n * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter\n */\n path: locationGetterSetter('$$path', function (path) {\n path = path !== null ? path.toString() : '';\n return path.charAt(0) === '/' ? path : '/' + path;\n }),\n /**\n * @ngdoc method\n * @name $location#search\n *\n * @description\n * This method is getter / setter.\n *\n * Return search part (as object) of current URL when called without any parameter.\n *\n * Change search part when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var searchObject = $location.search();\n * // => {foo: 'bar', baz: 'xoxo'}\n *\n * // set foo to 'yipee'\n * $location.search('foo', 'yipee');\n * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n * ```\n *\n * @param {string|Object.|Object.>} search New search params - string or\n * hash object.\n *\n * When called with a single argument the method acts as a setter, setting the `search` component\n * of `$location` to the specified value.\n *\n * If the argument is a hash object containing an array of values, these values will be encoded\n * as duplicate search parameters in the URL.\n *\n * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n * will override only a single search property.\n *\n * If `paramValue` is an array, it will override the property of the `search` component of\n * `$location` specified via the first argument.\n *\n * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n *\n * If `paramValue` is `true`, the property specified via the first argument will be added with no\n * value nor trailing equal sign.\n *\n * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n * one or more arguments returns `$location` object itself.\n */\n search: function (search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search) || isNumber(search)) {\n search = search.toString();\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\n search = copy(search, {});\n // remove object undefined or null properties\n forEach(search, function (value, key) {\n if (value == null) delete search[key];\n });\n this.$$search = search;\n } else {\n throw $locationMinErr('isrcharg', 'The first argument of the `$location#search()` call must be a string or an object.');\n }\n break;\n default:\n if (isUndefined(paramValue) || paramValue === null) {\n delete this.$$search[search];\n } else {\n this.$$search[search] = paramValue;\n }\n }\n this.$$compose();\n return this;\n },\n /**\n * @ngdoc method\n * @name $location#hash\n *\n * @description\n * This method is getter / setter.\n *\n * Returns the hash fragment when called without any parameters.\n *\n * Changes the hash fragment when called with a parameter and returns `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n * var hash = $location.hash();\n * // => \"hashValue\"\n * ```\n *\n * @param {(string|number)=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', function (hash) {\n return hash !== null ? hash.toString() : '';\n }),\n /**\n * @ngdoc method\n * @name $location#replace\n *\n * @description\n * If called, all changes to $location during the current `$digest` will replace the current history\n * record, instead of adding a new one.\n */\n replace: function () {\n this.$$replace = true;\n return this;\n }\n };\n forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function (Location) {\n Location.prototype = Object.create(locationPrototype);\n\n /**\n * @ngdoc method\n * @name $location#state\n *\n * @description\n * This method is getter / setter.\n *\n * Return the history state object when called without any parameter.\n *\n * Change the history state object when called with one parameter and return `$location`.\n * The state object is later passed to `pushState` or `replaceState`.\n *\n * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n * older browsers (like IE9 or Android < 4.0), don't use this method.\n *\n * @param {object=} state State object for pushState or replaceState\n * @return {object} state\n */\n Location.prototype.state = function (state) {\n if (!arguments.length) {\n return this.$$state;\n }\n if (Location !== LocationHtml5Url || !this.$$html5) {\n throw $locationMinErr('nostate', 'History API state support is available only ' + 'in HTML5 mode and only in browsers supporting HTML5 History API');\n }\n // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n // but we're changing the $$state reference to $browser.state() during the $digest\n // so the modification window is narrow.\n this.$$state = isUndefined(state) ? null : state;\n this.$$urlUpdatedByLocation = true;\n return this;\n };\n });\n function locationGetter(property) {\n return /** @this */function () {\n return this[property];\n };\n }\n function locationGetterSetter(property, preprocess) {\n return /** @this */function (value) {\n if (isUndefined(value)) {\n return this[property];\n }\n this[property] = preprocess(value);\n this.$$compose();\n return this;\n };\n }\n\n /**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n * - Watch and observe the URL.\n * - Change the URL.\n * - Synchronizes the URL with the browser when the user\n * - Changes the address bar.\n * - Clicks the back or forward button (or clicks a History link).\n * - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n /**\n * @ngdoc provider\n * @name $locationProvider\n * @this\n *\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\n function $LocationProvider() {\n var hashPrefix = '!',\n html5Mode = {\n enabled: false,\n requireBase: true,\n rewriteLinks: true\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#hashPrefix\n * @description\n * The default value for the prefix is `'!'`.\n * @param {string=} prefix Prefix for hash part (containing path and search)\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.hashPrefix = function (prefix) {\n if (isDefined(prefix)) {\n hashPrefix = prefix;\n return this;\n } else {\n return hashPrefix;\n }\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#html5Mode\n * @description\n * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n * properties:\n * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n * support `pushState`.\n * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n * whether or not a tag is required to be present. If `enabled` and `requireBase` are\n * true, and a base tag is not present, an error will be thrown when `$location` is injected.\n * See the {@link guide/$location $location guide for more information}\n * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled,\n * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will\n * only happen on links with an attribute that matches the given string. For example, if set\n * to `'internal-link'`, then the URL will only be rewritten for `` links.\n * Note that [attribute name normalization](guide/directive#normalization) does not apply\n * here, so `'internalLink'` will **not** match `'internal-link'`.\n *\n * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function (mode) {\n if (isBoolean(mode)) {\n html5Mode.enabled = mode;\n return this;\n } else if (isObject(mode)) {\n if (isBoolean(mode.enabled)) {\n html5Mode.enabled = mode.enabled;\n }\n if (isBoolean(mode.requireBase)) {\n html5Mode.requireBase = mode.requireBase;\n }\n if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) {\n html5Mode.rewriteLinks = mode.rewriteLinks;\n }\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change.\n *\n * This change can be prevented by calling\n * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n * details about event object. Upon successful change\n * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window', function ($rootScope, $browser, $sniffer, $rootElement, $window) {\n var $location,\n LocationMode,\n baseHref = $browser.baseHref(),\n // if base[href] is undefined, it defaults to ''\n initialUrl = $browser.url(),\n appBase;\n if (html5Mode.enabled) {\n if (!baseHref && html5Mode.requireBase) {\n throw $locationMinErr('nobase', '$location in HTML5 mode requires a tag to be present!');\n }\n appBase = serverBase(initialUrl) + (baseHref || '/');\n LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n } else {\n appBase = stripHash(initialUrl);\n LocationMode = LocationHashbangUrl;\n }\n var appBaseNoFile = stripFile(appBase);\n $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);\n $location.$$parseLinkUrl(initialUrl, initialUrl);\n $location.$$state = $browser.state();\n var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n // Determine if two URLs are equal despite potentially having different encoding/normalizing\n // such as $location.absUrl() vs $browser.url()\n // See https://github.com/angular/angular.js/issues/16592\n function urlsEqual(a, b) {\n return a === b || urlResolve(a).href === urlResolve(b).href;\n }\n function setBrowserUrlWithFallback(url, replace, state) {\n var oldUrl = $location.url();\n var oldState = $location.$$state;\n try {\n $browser.url(url, replace, state);\n\n // Make sure $location.state() returns referentially identical (not just deeply equal)\n // state object; this makes possible quick checking if the state changed in the digest\n // loop. Checking deep equality would be too expensive.\n $location.$$state = $browser.state();\n } catch (e) {\n // Restore old values if pushState fails\n $location.url(oldUrl);\n $location.$$state = oldState;\n throw e;\n }\n }\n $rootElement.on('click', function (event) {\n var rewriteLinks = html5Mode.rewriteLinks;\n // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n // currently we open nice url link and redirect then\n\n if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return;\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (nodeName_(elm[0]) !== 'a') {\n // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n }\n if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return;\n var absHref = elm.prop('href');\n // get the actual href attribute - see\n // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n var relHref = elm.attr('href') || elm.attr('xlink:href');\n if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n // an animation.\n absHref = urlResolve(absHref.animVal).href;\n }\n\n // Ignore when url is started with javascript: or mailto:\n if (IGNORE_URI_REGEXP.test(absHref)) return;\n if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n if ($location.$$parseLinkUrl(absHref, relHref)) {\n // We do a preventDefault for all urls that are part of the AngularJS application,\n // in html5mode and also without, so that we are able to abort navigation without\n // getting double entries in the location history.\n event.preventDefault();\n // update location manually\n if ($location.absUrl() !== $browser.url()) {\n $rootScope.$apply();\n }\n }\n }\n });\n\n // rewrite hashbang url <> html5 url\n if ($location.absUrl() !== initialUrl) {\n $browser.url($location.absUrl(), true);\n }\n var initializing = true;\n\n // update $location when $browser url changes\n $browser.onUrlChange(function (newUrl, newState) {\n if (!startsWith(newUrl, appBaseNoFile)) {\n // If we are navigating outside of the app then force a reload\n $window.location.href = newUrl;\n return;\n }\n $rootScope.$evalAsync(function () {\n var oldUrl = $location.absUrl();\n var oldState = $location.$$state;\n var defaultPrevented;\n $location.$$parse(newUrl);\n $location.$$state = newState;\n defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, newState, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n setBrowserUrlWithFallback(oldUrl, false, oldState);\n } else {\n initializing = false;\n afterLocationChange(oldUrl, oldState);\n }\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n });\n\n // update browser\n $rootScope.$watch(function $locationWatch() {\n if (initializing || $location.$$urlUpdatedByLocation) {\n $location.$$urlUpdatedByLocation = false;\n var oldUrl = $browser.url();\n var newUrl = $location.absUrl();\n var oldState = $browser.state();\n var currentReplace = $location.$$replace;\n var urlOrStateChanged = !urlsEqual(oldUrl, newUrl) || $location.$$html5 && $sniffer.history && oldState !== $location.$$state;\n if (initializing || urlOrStateChanged) {\n initializing = false;\n $rootScope.$evalAsync(function () {\n var newUrl = $location.absUrl();\n var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl, $location.$$state, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n } else {\n if (urlOrStateChanged) {\n setBrowserUrlWithFallback(newUrl, currentReplace, oldState === $location.$$state ? null : $location.$$state);\n }\n afterLocationChange(oldUrl, oldState);\n }\n });\n }\n }\n $location.$$replace = false;\n\n // we don't need to return anything because $evalAsync will make the digest loop dirty when\n // there is a change\n });\n return $location;\n function afterLocationChange(oldUrl, oldState) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl, $location.$$state, oldState);\n }\n }];\n }\n\n /**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * To reveal the location of the calls to `$log` in the JavaScript console,\n * you can \"blackbox\" the AngularJS source in your browser:\n *\n * [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source).\n * [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing).\n *\n * Note: Not all browsers support blackboxing.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n \n \n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n \n \n
\n

Reload this page with open console, enter text and hit the log button...

\n \n \n \n \n \n \n
\n
\n
\n */\n\n /**\n * @ngdoc provider\n * @name $logProvider\n * @this\n *\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\n function $LogProvider() {\n var debug = true,\n self = this;\n\n /**\n * @ngdoc method\n * @name $logProvider#debugEnabled\n * @description\n * @param {boolean=} flag enable or disable debug level messages\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.debugEnabled = function (flag) {\n if (isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n this.$get = ['$window', function ($window) {\n // Support: IE 9-11, Edge 12-14+\n // IE/Edge display errors in such a way that it requires the user to click in 4 places\n // to see the stack trace. There is no way to feature-detect it so there's a chance\n // of the user agent sniffing to go wrong but since it's only about logging, this shouldn't\n // break apps. Other browsers display errors in a sensible way and some of them map stack\n // traces along source maps if available so it makes sense to let browsers display it\n // as they want.\n var formatStackTrace = msie || /\\bEdge\\//.test($window.navigator && $window.navigator.userAgent);\n return {\n /**\n * @ngdoc method\n * @name $log#log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n /**\n * @ngdoc method\n * @name $log#info\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n /**\n * @ngdoc method\n * @name $log#warn\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n /**\n * @ngdoc method\n * @name $log#error\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n /**\n * @ngdoc method\n * @name $log#debug\n *\n * @description\n * Write a debug message\n */\n debug: function () {\n var fn = consoleLog('debug');\n return function () {\n if (debug) {\n fn.apply(self, arguments);\n }\n };\n }()\n };\n function formatError(arg) {\n if (isError(arg)) {\n if (arg.stack && formatStackTrace) {\n arg = arg.message && arg.stack.indexOf(arg.message) === -1 ? 'Error: ' + arg.message + '\\n' + arg.stack : arg.stack;\n } else if (arg.sourceURL) {\n arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n }\n }\n return arg;\n }\n function consoleLog(type) {\n var console = $window.console || {},\n logFn = console[type] || console.log || noop;\n return function () {\n var args = [];\n forEach(arguments, function (arg) {\n args.push(formatError(arg));\n });\n // Support: IE 9 only\n // console methods don't inherit from Function.prototype in IE 9 so we can't\n // call `logFn.apply(console, args)` directly.\n return Function.prototype.apply.call(logFn, console, args);\n };\n }\n }];\n }\n\n /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n var $parseMinErr = minErr('$parse');\n var objectValueOf = {}.constructor.prototype.valueOf;\n\n // Sandboxing AngularJS Expressions\n // ------------------------------\n // AngularJS expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by\n // various means such as obtaining a reference to native JS functions like the Function constructor.\n //\n // As an example, consider the following AngularJS expression:\n //\n // {}.toString.constructor('alert(\"evil JS code\")')\n //\n // It is important to realize that if you create an expression from a string that contains user provided\n // content then it is possible that your application contains a security vulnerability to an XSS style attack.\n //\n // See https://docs.angularjs.org/guide/security\n\n function getStringValue(name) {\n // Property names must be strings. This means that non-string objects cannot be used\n // as keys in an object. Any non-string object, including a number, is typecasted\n // into a string via the toString method.\n // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n //\n // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n // to a string. It's not always possible. If `name` is an object and its `toString` method is\n // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n //\n // TypeError: Cannot convert object to primitive value\n //\n // For performance reasons, we don't catch this error here and allow it to propagate up the call\n // stack. Note that you'll get the same error in JavaScript if you try to access a property using\n // such a 'broken' object as a key.\n return name + '';\n }\n var OPERATORS = createMap();\n forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function (operator) {\n OPERATORS[operator] = true;\n });\n var ESCAPE = {\n 'n': '\\n',\n 'f': '\\f',\n 'r': '\\r',\n 't': '\\t',\n 'v': '\\v',\n '\\'': '\\'',\n '\"': '\"'\n };\n\n /////////////////////////////////////////\n\n /**\n * @constructor\n */\n var Lexer = function Lexer(options) {\n this.options = options;\n };\n Lexer.prototype = {\n constructor: Lexer,\n lex: function (text) {\n this.text = text;\n this.index = 0;\n this.tokens = [];\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (ch === '\"' || ch === '\\'') {\n this.readString(ch);\n } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdentifierStart(this.peekMultichar())) {\n this.readIdent();\n } else if (this.is(ch, '(){}[].,;:?')) {\n this.tokens.push({\n index: this.index,\n text: ch\n });\n this.index++;\n } else if (this.isWhitespace(ch)) {\n this.index++;\n } else {\n var ch2 = ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var op1 = OPERATORS[ch];\n var op2 = OPERATORS[ch2];\n var op3 = OPERATORS[ch3];\n if (op1 || op2 || op3) {\n var token = op3 ? ch3 : op2 ? ch2 : ch;\n this.tokens.push({\n index: this.index,\n text: token,\n operator: true\n });\n this.index += token.length;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n }\n return this.tokens;\n },\n is: function (ch, chars) {\n return chars.indexOf(ch) !== -1;\n },\n peek: function (i) {\n var num = i || 1;\n return this.index + num < this.text.length ? this.text.charAt(this.index + num) : false;\n },\n isNumber: function (ch) {\n return '0' <= ch && ch <= '9' && typeof ch === 'string';\n },\n isWhitespace: function (ch) {\n // IE treats non-breaking space as \\u00A0\n return ch === ' ' || ch === '\\r' || ch === '\\t' || ch === '\\n' || ch === '\\v' || ch === '\\u00A0';\n },\n isIdentifierStart: function (ch) {\n return this.options.isIdentifierStart ? this.options.isIdentifierStart(ch, this.codePointAt(ch)) : this.isValidIdentifierStart(ch);\n },\n isValidIdentifierStart: function (ch) {\n return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || '_' === ch || ch === '$';\n },\n isIdentifierContinue: function (ch) {\n return this.options.isIdentifierContinue ? this.options.isIdentifierContinue(ch, this.codePointAt(ch)) : this.isValidIdentifierContinue(ch);\n },\n isValidIdentifierContinue: function (ch, cp) {\n return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);\n },\n codePointAt: function (ch) {\n if (ch.length === 1) return ch.charCodeAt(0);\n // eslint-disable-next-line no-bitwise\n return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00;\n },\n peekMultichar: function () {\n var ch = this.text.charAt(this.index);\n var peek = this.peek();\n if (!peek) {\n return ch;\n }\n var cp1 = ch.charCodeAt(0);\n var cp2 = peek.charCodeAt(0);\n if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) {\n return ch + peek;\n }\n return ch;\n },\n isExpOperator: function (ch) {\n return ch === '-' || ch === '+' || this.isNumber(ch);\n },\n throwError: function (error, start, end) {\n end = end || this.index;\n var colStr = isDefined(start) ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']' : ' ' + end;\n throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].', error, colStr, this.text);\n },\n readNumber: function () {\n var number = '';\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = lowercase(this.text.charAt(this.index));\n if (ch === '.' || this.isNumber(ch)) {\n number += ch;\n } else {\n var peekCh = this.peek();\n if (ch === 'e' && this.isExpOperator(peekCh)) {\n number += ch;\n } else if (this.isExpOperator(ch) && peekCh && this.isNumber(peekCh) && number.charAt(number.length - 1) === 'e') {\n number += ch;\n } else if (this.isExpOperator(ch) && (!peekCh || !this.isNumber(peekCh)) && number.charAt(number.length - 1) === 'e') {\n this.throwError('Invalid exponent');\n } else {\n break;\n }\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: number,\n constant: true,\n value: Number(number)\n });\n },\n readIdent: function () {\n var start = this.index;\n this.index += this.peekMultichar().length;\n while (this.index < this.text.length) {\n var ch = this.peekMultichar();\n if (!this.isIdentifierContinue(ch)) {\n break;\n }\n this.index += ch.length;\n }\n this.tokens.push({\n index: start,\n text: this.text.slice(start, this.index),\n identifier: true\n });\n },\n readString: function (quote) {\n var start = this.index;\n this.index++;\n var string = '';\n var rawString = quote;\n var escape = false;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n rawString += ch;\n if (escape) {\n if (ch === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5);\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n }\n this.index += 4;\n string += String.fromCharCode(parseInt(hex, 16));\n } else {\n var rep = ESCAPE[ch];\n string = string + (rep || ch);\n }\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n this.index++;\n this.tokens.push({\n index: start,\n text: rawString,\n constant: true,\n value: string\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n };\n var AST = function AST(lexer, options) {\n this.lexer = lexer;\n this.options = options;\n };\n AST.Program = 'Program';\n AST.ExpressionStatement = 'ExpressionStatement';\n AST.AssignmentExpression = 'AssignmentExpression';\n AST.ConditionalExpression = 'ConditionalExpression';\n AST.LogicalExpression = 'LogicalExpression';\n AST.BinaryExpression = 'BinaryExpression';\n AST.UnaryExpression = 'UnaryExpression';\n AST.CallExpression = 'CallExpression';\n AST.MemberExpression = 'MemberExpression';\n AST.Identifier = 'Identifier';\n AST.Literal = 'Literal';\n AST.ArrayExpression = 'ArrayExpression';\n AST.Property = 'Property';\n AST.ObjectExpression = 'ObjectExpression';\n AST.ThisExpression = 'ThisExpression';\n AST.LocalsExpression = 'LocalsExpression';\n\n // Internal use only\n AST.NGValueParameter = 'NGValueParameter';\n AST.prototype = {\n ast: function (text) {\n this.text = text;\n this.tokens = this.lexer.lex(text);\n var value = this.program();\n if (this.tokens.length !== 0) {\n this.throwError('is an unexpected token', this.tokens[0]);\n }\n return value;\n },\n program: function () {\n var body = [];\n while (true) {\n if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']')) body.push(this.expressionStatement());\n if (!this.expect(';')) {\n return {\n type: AST.Program,\n body: body\n };\n }\n }\n },\n expressionStatement: function () {\n return {\n type: AST.ExpressionStatement,\n expression: this.filterChain()\n };\n },\n filterChain: function () {\n var left = this.expression();\n while (this.expect('|')) {\n left = this.filter(left);\n }\n return left;\n },\n expression: function () {\n return this.assignment();\n },\n assignment: function () {\n var result = this.ternary();\n if (this.expect('=')) {\n if (!isAssignable(result)) {\n throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');\n }\n result = {\n type: AST.AssignmentExpression,\n left: result,\n right: this.assignment(),\n operator: '='\n };\n }\n return result;\n },\n ternary: function () {\n var test = this.logicalOR();\n var alternate;\n var consequent;\n if (this.expect('?')) {\n alternate = this.expression();\n if (this.consume(':')) {\n consequent = this.expression();\n return {\n type: AST.ConditionalExpression,\n test: test,\n alternate: alternate,\n consequent: consequent\n };\n }\n }\n return test;\n },\n logicalOR: function () {\n var left = this.logicalAND();\n while (this.expect('||')) {\n left = {\n type: AST.LogicalExpression,\n operator: '||',\n left: left,\n right: this.logicalAND()\n };\n }\n return left;\n },\n logicalAND: function () {\n var left = this.equality();\n while (this.expect('&&')) {\n left = {\n type: AST.LogicalExpression,\n operator: '&&',\n left: left,\n right: this.equality()\n };\n }\n return left;\n },\n equality: function () {\n var left = this.relational();\n var token;\n while (token = this.expect('==', '!=', '===', '!==')) {\n left = {\n type: AST.BinaryExpression,\n operator: token.text,\n left: left,\n right: this.relational()\n };\n }\n return left;\n },\n relational: function () {\n var left = this.additive();\n var token;\n while (token = this.expect('<', '>', '<=', '>=')) {\n left = {\n type: AST.BinaryExpression,\n operator: token.text,\n left: left,\n right: this.additive()\n };\n }\n return left;\n },\n additive: function () {\n var left = this.multiplicative();\n var token;\n while (token = this.expect('+', '-')) {\n left = {\n type: AST.BinaryExpression,\n operator: token.text,\n left: left,\n right: this.multiplicative()\n };\n }\n return left;\n },\n multiplicative: function () {\n var left = this.unary();\n var token;\n while (token = this.expect('*', '/', '%')) {\n left = {\n type: AST.BinaryExpression,\n operator: token.text,\n left: left,\n right: this.unary()\n };\n }\n return left;\n },\n unary: function () {\n var token;\n if (token = this.expect('+', '-', '!')) {\n return {\n type: AST.UnaryExpression,\n operator: token.text,\n prefix: true,\n argument: this.unary()\n };\n } else {\n return this.primary();\n }\n },\n primary: function () {\n var primary;\n if (this.expect('(')) {\n primary = this.filterChain();\n this.consume(')');\n } else if (this.expect('[')) {\n primary = this.arrayDeclaration();\n } else if (this.expect('{')) {\n primary = this.object();\n } else if (this.selfReferential.hasOwnProperty(this.peek().text)) {\n primary = copy(this.selfReferential[this.consume().text]);\n } else if (this.options.literals.hasOwnProperty(this.peek().text)) {\n primary = {\n type: AST.Literal,\n value: this.options.literals[this.consume().text]\n };\n } else if (this.peek().identifier) {\n primary = this.identifier();\n } else if (this.peek().constant) {\n primary = this.constant();\n } else {\n this.throwError('not a primary expression', this.peek());\n }\n var next;\n while (next = this.expect('(', '[', '.')) {\n if (next.text === '(') {\n primary = {\n type: AST.CallExpression,\n callee: primary,\n arguments: this.parseArguments()\n };\n this.consume(')');\n } else if (next.text === '[') {\n primary = {\n type: AST.MemberExpression,\n object: primary,\n property: this.expression(),\n computed: true\n };\n this.consume(']');\n } else if (next.text === '.') {\n primary = {\n type: AST.MemberExpression,\n object: primary,\n property: this.identifier(),\n computed: false\n };\n } else {\n this.throwError('IMPOSSIBLE');\n }\n }\n return primary;\n },\n filter: function (baseExpression) {\n var args = [baseExpression];\n var result = {\n type: AST.CallExpression,\n callee: this.identifier(),\n arguments: args,\n filter: true\n };\n while (this.expect(':')) {\n args.push(this.expression());\n }\n return result;\n },\n parseArguments: function () {\n var args = [];\n if (this.peekToken().text !== ')') {\n do {\n args.push(this.filterChain());\n } while (this.expect(','));\n }\n return args;\n },\n identifier: function () {\n var token = this.consume();\n if (!token.identifier) {\n this.throwError('is not a valid identifier', token);\n }\n return {\n type: AST.Identifier,\n name: token.text\n };\n },\n constant: function () {\n // TODO check that it is a constant\n return {\n type: AST.Literal,\n value: this.consume().value\n };\n },\n arrayDeclaration: function () {\n var elements = [];\n if (this.peekToken().text !== ']') {\n do {\n if (this.peek(']')) {\n // Support trailing commas per ES5.1.\n break;\n }\n elements.push(this.expression());\n } while (this.expect(','));\n }\n this.consume(']');\n return {\n type: AST.ArrayExpression,\n elements: elements\n };\n },\n object: function () {\n var properties = [],\n property;\n if (this.peekToken().text !== '}') {\n do {\n if (this.peek('}')) {\n // Support trailing commas per ES5.1.\n break;\n }\n property = {\n type: AST.Property,\n kind: 'init'\n };\n if (this.peek().constant) {\n property.key = this.constant();\n property.computed = false;\n this.consume(':');\n property.value = this.expression();\n } else if (this.peek().identifier) {\n property.key = this.identifier();\n property.computed = false;\n if (this.peek(':')) {\n this.consume(':');\n property.value = this.expression();\n } else {\n property.value = property.key;\n }\n } else if (this.peek('[')) {\n this.consume('[');\n property.key = this.expression();\n this.consume(']');\n property.computed = true;\n this.consume(':');\n property.value = this.expression();\n } else {\n this.throwError('invalid key', this.peek());\n }\n properties.push(property);\n } while (this.expect(','));\n }\n this.consume('}');\n return {\n type: AST.ObjectExpression,\n properties: properties\n };\n },\n throwError: function (msg, token) {\n throw $parseMinErr('syntax', 'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].', token.text, msg, token.index + 1, this.text, this.text.substring(token.index));\n },\n consume: function (e1) {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n var token = this.expect(e1);\n if (!token) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n return token;\n },\n peekToken: function () {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n return this.tokens[0];\n },\n peek: function (e1, e2, e3, e4) {\n return this.peekAhead(0, e1, e2, e3, e4);\n },\n peekAhead: function (i, e1, e2, e3, e4) {\n if (this.tokens.length > i) {\n var token = this.tokens[i];\n var t = token.text;\n if (t === e1 || t === e2 || t === e3 || t === e4 || !e1 && !e2 && !e3 && !e4) {\n return token;\n }\n }\n return false;\n },\n expect: function (e1, e2, e3, e4) {\n var token = this.peek(e1, e2, e3, e4);\n if (token) {\n this.tokens.shift();\n return token;\n }\n return false;\n },\n selfReferential: {\n 'this': {\n type: AST.ThisExpression\n },\n '$locals': {\n type: AST.LocalsExpression\n }\n }\n };\n function ifDefined(v, d) {\n return typeof v !== 'undefined' ? v : d;\n }\n function plusFn(l, r) {\n if (typeof l === 'undefined') return r;\n if (typeof r === 'undefined') return l;\n return l + r;\n }\n function isStateless($filter, filterName) {\n var fn = $filter(filterName);\n return !fn.$stateful;\n }\n var PURITY_ABSOLUTE = 1;\n var PURITY_RELATIVE = 2;\n\n // Detect nodes which could depend on non-shallow state of objects\n function isPure(node, parentIsPure) {\n switch (node.type) {\n // Computed members might invoke a stateful toString()\n case AST.MemberExpression:\n if (node.computed) {\n return false;\n }\n break;\n\n // Unary always convert to primative\n case AST.UnaryExpression:\n return PURITY_ABSOLUTE;\n\n // The binary + operator can invoke a stateful toString().\n case AST.BinaryExpression:\n return node.operator !== '+' ? PURITY_ABSOLUTE : false;\n\n // Functions / filters probably read state from within objects\n case AST.CallExpression:\n return false;\n }\n return undefined === parentIsPure ? PURITY_RELATIVE : parentIsPure;\n }\n function findConstantAndWatchExpressions(ast, $filter, parentIsPure) {\n var allConstants;\n var argsToWatch;\n var isStatelessFilter;\n var astIsPure = ast.isPure = isPure(ast, parentIsPure);\n switch (ast.type) {\n case AST.Program:\n allConstants = true;\n forEach(ast.body, function (expr) {\n findConstantAndWatchExpressions(expr.expression, $filter, astIsPure);\n allConstants = allConstants && expr.expression.constant;\n });\n ast.constant = allConstants;\n break;\n case AST.Literal:\n ast.constant = true;\n ast.toWatch = [];\n break;\n case AST.UnaryExpression:\n findConstantAndWatchExpressions(ast.argument, $filter, astIsPure);\n ast.constant = ast.argument.constant;\n ast.toWatch = ast.argument.toWatch;\n break;\n case AST.BinaryExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n break;\n case AST.LogicalExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.ConditionalExpression:\n findConstantAndWatchExpressions(ast.test, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.alternate, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.consequent, $filter, astIsPure);\n ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.Identifier:\n ast.constant = false;\n ast.toWatch = [ast];\n break;\n case AST.MemberExpression:\n findConstantAndWatchExpressions(ast.object, $filter, astIsPure);\n if (ast.computed) {\n findConstantAndWatchExpressions(ast.property, $filter, astIsPure);\n }\n ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.CallExpression:\n isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false;\n allConstants = isStatelessFilter;\n argsToWatch = [];\n forEach(ast.arguments, function (expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = isStatelessFilter ? argsToWatch : [ast];\n break;\n case AST.AssignmentExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = [ast];\n break;\n case AST.ArrayExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.elements, function (expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ObjectExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.properties, function (property) {\n findConstantAndWatchExpressions(property.value, $filter, astIsPure);\n allConstants = allConstants && property.value.constant;\n argsToWatch.push.apply(argsToWatch, property.value.toWatch);\n if (property.computed) {\n //`{[key]: value}` implicitly does `key.toString()` which may be non-pure\n findConstantAndWatchExpressions(property.key, $filter, /*parentIsPure=*/false);\n allConstants = allConstants && property.key.constant;\n argsToWatch.push.apply(argsToWatch, property.key.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ThisExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n case AST.LocalsExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n }\n }\n function getInputs(body) {\n if (body.length !== 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n }\n function isAssignable(ast) {\n return ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n }\n function assignableAST(ast) {\n if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n return {\n type: AST.AssignmentExpression,\n left: ast.body[0].expression,\n right: {\n type: AST.NGValueParameter\n },\n operator: '='\n };\n }\n }\n function isLiteral(ast) {\n return ast.body.length === 0 || ast.body.length === 1 && (ast.body[0].expression.type === AST.Literal || ast.body[0].expression.type === AST.ArrayExpression || ast.body[0].expression.type === AST.ObjectExpression);\n }\n function isConstant(ast) {\n return ast.constant;\n }\n function ASTCompiler($filter) {\n this.$filter = $filter;\n }\n ASTCompiler.prototype = {\n compile: function (ast) {\n var self = this;\n this.state = {\n nextId: 0,\n filters: {},\n fn: {\n vars: [],\n body: [],\n own: {}\n },\n assign: {\n vars: [],\n body: [],\n own: {}\n },\n inputs: []\n };\n findConstantAndWatchExpressions(ast, self.$filter);\n var extra = '';\n var assignable;\n this.stage = 'assign';\n if (assignable = assignableAST(ast)) {\n this.state.computing = 'assign';\n var result = this.nextId();\n this.recurse(assignable, result);\n this.return_(result);\n extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');\n }\n var toWatch = getInputs(ast.body);\n self.stage = 'inputs';\n forEach(toWatch, function (watch, key) {\n var fnKey = 'fn' + key;\n self.state[fnKey] = {\n vars: [],\n body: [],\n own: {}\n };\n self.state.computing = fnKey;\n var intoId = self.nextId();\n self.recurse(watch, intoId);\n self.return_(intoId);\n self.state.inputs.push({\n name: fnKey,\n isPure: watch.isPure\n });\n watch.watchId = key;\n });\n this.state.computing = 'fn';\n this.stage = 'main';\n this.recurse(ast);\n var fnString =\n // The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n // This is a workaround for this until we do a better job at only removing the prefix only when we should.\n '\"' + this.USE + ' ' + this.STRICT + '\";\\n' + this.filterPrefix() + 'var fn=' + this.generateFunction('fn', 's,l,a,i') + extra + this.watchFns() + 'return fn;';\n\n // eslint-disable-next-line no-new-func\n var fn = new Function('$filter', 'getStringValue', 'ifDefined', 'plus', fnString)(this.$filter, getStringValue, ifDefined, plusFn);\n this.state = this.stage = undefined;\n return fn;\n },\n USE: 'use',\n STRICT: 'strict',\n watchFns: function () {\n var result = [];\n var inputs = this.state.inputs;\n var self = this;\n forEach(inputs, function (input) {\n result.push('var ' + input.name + '=' + self.generateFunction(input.name, 's'));\n if (input.isPure) {\n result.push(input.name, '.isPure=' + JSON.stringify(input.isPure) + ';');\n }\n });\n if (inputs.length) {\n result.push('fn.inputs=[' + inputs.map(function (i) {\n return i.name;\n }).join(',') + '];');\n }\n return result.join('');\n },\n generateFunction: function (name, params) {\n return 'function(' + params + '){' + this.varsPrefix(name) + this.body(name) + '};';\n },\n filterPrefix: function () {\n var parts = [];\n var self = this;\n forEach(this.state.filters, function (id, filter) {\n parts.push(id + '=$filter(' + self.escape(filter) + ')');\n });\n if (parts.length) return 'var ' + parts.join(',') + ';';\n return '';\n },\n varsPrefix: function (section) {\n return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';\n },\n body: function (section) {\n return this.state[section].body.join('');\n },\n recurse: function (ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var left,\n right,\n self = this,\n args,\n expression,\n computed;\n recursionFn = recursionFn || noop;\n if (!skipWatchIdCheck && isDefined(ast.watchId)) {\n intoId = intoId || this.nextId();\n this.if_('i', this.lazyAssign(intoId, this.computedMember('i', ast.watchId)), this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true));\n return;\n }\n switch (ast.type) {\n case AST.Program:\n forEach(ast.body, function (expression, pos) {\n self.recurse(expression.expression, undefined, undefined, function (expr) {\n right = expr;\n });\n if (pos !== ast.body.length - 1) {\n self.current().body.push(right, ';');\n } else {\n self.return_(right);\n }\n });\n break;\n case AST.Literal:\n expression = this.escape(ast.value);\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.UnaryExpression:\n this.recurse(ast.argument, undefined, undefined, function (expr) {\n right = expr;\n });\n expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.BinaryExpression:\n this.recurse(ast.left, undefined, undefined, function (expr) {\n left = expr;\n });\n this.recurse(ast.right, undefined, undefined, function (expr) {\n right = expr;\n });\n if (ast.operator === '+') {\n expression = this.plus(left, right);\n } else if (ast.operator === '-') {\n expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n } else {\n expression = '(' + left + ')' + ast.operator + '(' + right + ')';\n }\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.LogicalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.left, intoId);\n self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));\n recursionFn(intoId);\n break;\n case AST.ConditionalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.test, intoId);\n self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));\n recursionFn(intoId);\n break;\n case AST.Identifier:\n intoId = intoId || this.nextId();\n if (nameId) {\n nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');\n nameId.computed = false;\n nameId.name = ast.name;\n }\n self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)), function () {\n self.if_(self.stage === 'inputs' || 's', function () {\n if (create && create !== 1) {\n self.if_(self.isNull(self.nonComputedMember('s', ast.name)), self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));\n }\n self.assign(intoId, self.nonComputedMember('s', ast.name));\n });\n }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name)));\n recursionFn(intoId);\n break;\n case AST.MemberExpression:\n left = nameId && (nameId.context = this.nextId()) || this.nextId();\n intoId = intoId || this.nextId();\n self.recurse(ast.object, left, undefined, function () {\n self.if_(self.notNull(left), function () {\n if (ast.computed) {\n right = self.nextId();\n self.recurse(ast.property, right);\n self.getStringValue(right);\n if (create && create !== 1) {\n self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));\n }\n expression = self.computedMember(left, right);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = true;\n nameId.name = right;\n }\n } else {\n if (create && create !== 1) {\n self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));\n }\n expression = self.nonComputedMember(left, ast.property.name);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = false;\n nameId.name = ast.property.name;\n }\n }\n }, function () {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n }, !!create);\n break;\n case AST.CallExpression:\n intoId = intoId || this.nextId();\n if (ast.filter) {\n right = self.filter(ast.callee.name);\n args = [];\n forEach(ast.arguments, function (expr) {\n var argument = self.nextId();\n self.recurse(expr, argument);\n args.push(argument);\n });\n expression = right + '(' + args.join(',') + ')';\n self.assign(intoId, expression);\n recursionFn(intoId);\n } else {\n right = self.nextId();\n left = {};\n args = [];\n self.recurse(ast.callee, right, left, function () {\n self.if_(self.notNull(right), function () {\n forEach(ast.arguments, function (expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function (argument) {\n args.push(argument);\n });\n });\n if (left.name) {\n expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';\n } else {\n expression = right + '(' + args.join(',') + ')';\n }\n self.assign(intoId, expression);\n }, function () {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n });\n }\n break;\n case AST.AssignmentExpression:\n right = this.nextId();\n left = {};\n this.recurse(ast.left, undefined, left, function () {\n self.if_(self.notNull(left.context), function () {\n self.recurse(ast.right, right);\n expression = self.member(left.context, left.name, left.computed) + ast.operator + right;\n self.assign(intoId, expression);\n recursionFn(intoId || expression);\n });\n }, 1);\n break;\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function (expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function (argument) {\n args.push(argument);\n });\n });\n expression = '[' + args.join(',') + ']';\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.ObjectExpression:\n args = [];\n computed = false;\n forEach(ast.properties, function (property) {\n if (property.computed) {\n computed = true;\n }\n });\n if (computed) {\n intoId = intoId || this.nextId();\n this.assign(intoId, '{}');\n forEach(ast.properties, function (property) {\n if (property.computed) {\n left = self.nextId();\n self.recurse(property.key, left);\n } else {\n left = property.key.type === AST.Identifier ? property.key.name : '' + property.key.value;\n }\n right = self.nextId();\n self.recurse(property.value, right);\n self.assign(self.member(intoId, left, property.computed), right);\n });\n } else {\n forEach(ast.properties, function (property) {\n self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function (expr) {\n args.push(self.escape(property.key.type === AST.Identifier ? property.key.name : '' + property.key.value) + ':' + expr);\n });\n });\n expression = '{' + args.join(',') + '}';\n this.assign(intoId, expression);\n }\n recursionFn(intoId || expression);\n break;\n case AST.ThisExpression:\n this.assign(intoId, 's');\n recursionFn(intoId || 's');\n break;\n case AST.LocalsExpression:\n this.assign(intoId, 'l');\n recursionFn(intoId || 'l');\n break;\n case AST.NGValueParameter:\n this.assign(intoId, 'v');\n recursionFn(intoId || 'v');\n break;\n }\n },\n getHasOwnProperty: function (element, property) {\n var key = element + '.' + property;\n var own = this.current().own;\n if (!own.hasOwnProperty(key)) {\n own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');\n }\n return own[key];\n },\n assign: function (id, value) {\n if (!id) return;\n this.current().body.push(id, '=', value, ';');\n return id;\n },\n filter: function (filterName) {\n if (!this.state.filters.hasOwnProperty(filterName)) {\n this.state.filters[filterName] = this.nextId(true);\n }\n return this.state.filters[filterName];\n },\n ifDefined: function (id, defaultValue) {\n return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';\n },\n plus: function (left, right) {\n return 'plus(' + left + ',' + right + ')';\n },\n return_: function (id) {\n this.current().body.push('return ', id, ';');\n },\n if_: function (test, alternate, consequent) {\n if (test === true) {\n alternate();\n } else {\n var body = this.current().body;\n body.push('if(', test, '){');\n alternate();\n body.push('}');\n if (consequent) {\n body.push('else{');\n consequent();\n body.push('}');\n }\n }\n },\n not: function (expression) {\n return '!(' + expression + ')';\n },\n isNull: function (expression) {\n return expression + '==null';\n },\n notNull: function (expression) {\n return expression + '!=null';\n },\n nonComputedMember: function (left, right) {\n var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;\n var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;\n if (SAFE_IDENTIFIER.test(right)) {\n return left + '.' + right;\n } else {\n return left + '[\"' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '\"]';\n }\n },\n computedMember: function (left, right) {\n return left + '[' + right + ']';\n },\n member: function (left, right, computed) {\n if (computed) return this.computedMember(left, right);\n return this.nonComputedMember(left, right);\n },\n getStringValue: function (item) {\n this.assign(item, 'getStringValue(' + item + ')');\n },\n lazyRecurse: function (ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var self = this;\n return function () {\n self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n };\n },\n lazyAssign: function (id, value) {\n var self = this;\n return function () {\n self.assign(id, value);\n };\n },\n stringEscapeRegex: /[^ a-zA-Z0-9]/g,\n stringEscapeFn: function (c) {\n return '\\\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n },\n escape: function (value) {\n if (isString(value)) return '\\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\\'';\n if (isNumber(value)) return value.toString();\n if (value === true) return 'true';\n if (value === false) return 'false';\n if (value === null) return 'null';\n if (typeof value === 'undefined') return 'undefined';\n throw $parseMinErr('esc', 'IMPOSSIBLE');\n },\n nextId: function (skip, init) {\n var id = 'v' + this.state.nextId++;\n if (!skip) {\n this.current().vars.push(id + (init ? '=' + init : ''));\n }\n return id;\n },\n current: function () {\n return this.state[this.state.computing];\n }\n };\n function ASTInterpreter($filter) {\n this.$filter = $filter;\n }\n ASTInterpreter.prototype = {\n compile: function (ast) {\n var self = this;\n findConstantAndWatchExpressions(ast, self.$filter);\n var assignable;\n var assign;\n if (assignable = assignableAST(ast)) {\n assign = this.recurse(assignable);\n }\n var toWatch = getInputs(ast.body);\n var inputs;\n if (toWatch) {\n inputs = [];\n forEach(toWatch, function (watch, key) {\n var input = self.recurse(watch);\n input.isPure = watch.isPure;\n watch.input = input;\n inputs.push(input);\n watch.watchId = key;\n });\n }\n var expressions = [];\n forEach(ast.body, function (expression) {\n expressions.push(self.recurse(expression.expression));\n });\n var fn = ast.body.length === 0 ? noop : ast.body.length === 1 ? expressions[0] : function (scope, locals) {\n var lastValue;\n forEach(expressions, function (exp) {\n lastValue = exp(scope, locals);\n });\n return lastValue;\n };\n if (assign) {\n fn.assign = function (scope, value, locals) {\n return assign(scope, locals, value);\n };\n }\n if (inputs) {\n fn.inputs = inputs;\n }\n return fn;\n },\n recurse: function (ast, context, create) {\n var left,\n right,\n self = this,\n args;\n if (ast.input) {\n return this.inputs(ast.input, ast.watchId);\n }\n switch (ast.type) {\n case AST.Literal:\n return this.value(ast.value, context);\n case AST.UnaryExpression:\n right = this.recurse(ast.argument);\n return this['unary' + ast.operator](right, context);\n case AST.BinaryExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.LogicalExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.ConditionalExpression:\n return this['ternary?:'](this.recurse(ast.test), this.recurse(ast.alternate), this.recurse(ast.consequent), context);\n case AST.Identifier:\n return self.identifier(ast.name, context, create);\n case AST.MemberExpression:\n left = this.recurse(ast.object, false, !!create);\n if (!ast.computed) {\n right = ast.property.name;\n }\n if (ast.computed) right = this.recurse(ast.property);\n return ast.computed ? this.computedMember(left, right, context, create) : this.nonComputedMember(left, right, context, create);\n case AST.CallExpression:\n args = [];\n forEach(ast.arguments, function (expr) {\n args.push(self.recurse(expr));\n });\n if (ast.filter) right = this.$filter(ast.callee.name);\n if (!ast.filter) right = this.recurse(ast.callee, true);\n return ast.filter ? function (scope, locals, assign, inputs) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n var value = right.apply(undefined, values, inputs);\n return context ? {\n context: undefined,\n name: undefined,\n value: value\n } : value;\n } : function (scope, locals, assign, inputs) {\n var rhs = right(scope, locals, assign, inputs);\n var value;\n if (rhs.value != null) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n value = rhs.value.apply(rhs.context, values);\n }\n return context ? {\n value: value\n } : value;\n };\n case AST.AssignmentExpression:\n left = this.recurse(ast.left, true, 1);\n right = this.recurse(ast.right);\n return function (scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n lhs.context[lhs.name] = rhs;\n return context ? {\n value: rhs\n } : rhs;\n };\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function (expr) {\n args.push(self.recurse(expr));\n });\n return function (scope, locals, assign, inputs) {\n var value = [];\n for (var i = 0; i < args.length; ++i) {\n value.push(args[i](scope, locals, assign, inputs));\n }\n return context ? {\n value: value\n } : value;\n };\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function (property) {\n if (property.computed) {\n args.push({\n key: self.recurse(property.key),\n computed: true,\n value: self.recurse(property.value)\n });\n } else {\n args.push({\n key: property.key.type === AST.Identifier ? property.key.name : '' + property.key.value,\n computed: false,\n value: self.recurse(property.value)\n });\n }\n });\n return function (scope, locals, assign, inputs) {\n var value = {};\n for (var i = 0; i < args.length; ++i) {\n if (args[i].computed) {\n value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);\n } else {\n value[args[i].key] = args[i].value(scope, locals, assign, inputs);\n }\n }\n return context ? {\n value: value\n } : value;\n };\n case AST.ThisExpression:\n return function (scope) {\n return context ? {\n value: scope\n } : scope;\n };\n case AST.LocalsExpression:\n return function (scope, locals) {\n return context ? {\n value: locals\n } : locals;\n };\n case AST.NGValueParameter:\n return function (scope, locals, assign) {\n return context ? {\n value: assign\n } : assign;\n };\n }\n },\n 'unary+': function (argument, context) {\n return function (scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = +arg;\n } else {\n arg = 0;\n }\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'unary-': function (argument, context) {\n return function (scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = -arg;\n } else {\n arg = -0;\n }\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'unary!': function (argument, context) {\n return function (scope, locals, assign, inputs) {\n var arg = !argument(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary+': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = plusFn(lhs, rhs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary-': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary*': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary/': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary%': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary===': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary!==': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary==': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary!=': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary<': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary>': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary<=': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary>=': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary&&': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'binary||': function (left, right, context) {\n return function (scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n 'ternary?:': function (test, alternate, consequent, context) {\n return function (scope, locals, assign, inputs) {\n var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);\n return context ? {\n value: arg\n } : arg;\n };\n },\n value: function (value, context) {\n return function () {\n return context ? {\n context: undefined,\n name: undefined,\n value: value\n } : value;\n };\n },\n identifier: function (name, context, create) {\n return function (scope, locals, assign, inputs) {\n var base = locals && name in locals ? locals : scope;\n if (create && create !== 1 && base && base[name] == null) {\n base[name] = {};\n }\n var value = base ? base[name] : undefined;\n if (context) {\n return {\n context: base,\n name: name,\n value: value\n };\n } else {\n return value;\n }\n };\n },\n computedMember: function (left, right, context, create) {\n return function (scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs;\n var value;\n if (lhs != null) {\n rhs = right(scope, locals, assign, inputs);\n rhs = getStringValue(rhs);\n if (create && create !== 1) {\n if (lhs && !lhs[rhs]) {\n lhs[rhs] = {};\n }\n }\n value = lhs[rhs];\n }\n if (context) {\n return {\n context: lhs,\n name: rhs,\n value: value\n };\n } else {\n return value;\n }\n };\n },\n nonComputedMember: function (left, right, context, create) {\n return function (scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n if (create && create !== 1) {\n if (lhs && lhs[right] == null) {\n lhs[right] = {};\n }\n }\n var value = lhs != null ? lhs[right] : undefined;\n if (context) {\n return {\n context: lhs,\n name: right,\n value: value\n };\n } else {\n return value;\n }\n };\n },\n inputs: function (input, watchId) {\n return function (scope, value, locals, inputs) {\n if (inputs) return inputs[watchId];\n return input(scope, value, locals);\n };\n }\n };\n\n /**\n * @constructor\n */\n function Parser(lexer, $filter, options) {\n this.ast = new AST(lexer, options);\n this.astCompiler = options.csp ? new ASTInterpreter($filter) : new ASTCompiler($filter);\n }\n Parser.prototype = {\n constructor: Parser,\n parse: function (text) {\n var ast = this.getAst(text);\n var fn = this.astCompiler.compile(ast.ast);\n fn.literal = isLiteral(ast.ast);\n fn.constant = isConstant(ast.ast);\n fn.oneTime = ast.oneTime;\n return fn;\n },\n getAst: function (exp) {\n var oneTime = false;\n exp = exp.trim();\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n return {\n ast: this.ast.ast(exp),\n oneTime: oneTime\n };\n }\n };\n function getValueOf(value) {\n return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n }\n\n ///////////////////////////////////\n\n /**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts AngularJS {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'AngularJS'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('AngularJS');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n /**\n * @ngdoc provider\n * @name $parseProvider\n * @this\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\n function $ParseProvider() {\n var cache = createMap();\n var literals = {\n 'true': true,\n 'false': false,\n 'null': null,\n 'undefined': undefined\n };\n var identStart, identContinue;\n\n /**\n * @ngdoc method\n * @name $parseProvider#addLiteral\n * @description\n *\n * Configure $parse service to add literal values that will be present as literal at expressions.\n *\n * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.\n * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.\n *\n **/\n this.addLiteral = function (literalName, literalValue) {\n literals[literalName] = literalValue;\n };\n\n /**\n * @ngdoc method\n * @name $parseProvider#setIdentifierFns\n *\n * @description\n *\n * Allows defining the set of characters that are allowed in AngularJS expressions. The function\n * `identifierStart` will get called to know if a given character is a valid character to be the\n * first character for an identifier. The function `identifierContinue` will get called to know if\n * a given character is a valid character to be a follow-up identifier character. The functions\n * `identifierStart` and `identifierContinue` will receive as arguments the single character to be\n * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in\n * mind that the `string` parameter can be two characters long depending on the character\n * representation. It is expected for the function to return `true` or `false`, whether that\n * character is allowed or not.\n *\n * Since this function will be called extensively, keep the implementation of these functions fast,\n * as the performance of these functions have a direct impact on the expressions parsing speed.\n *\n * @param {function=} identifierStart The function that will decide whether the given character is\n * a valid identifier start character.\n * @param {function=} identifierContinue The function that will decide whether the given character is\n * a valid identifier continue character.\n */\n this.setIdentifierFns = function (identifierStart, identifierContinue) {\n identStart = identifierStart;\n identContinue = identifierContinue;\n return this;\n };\n this.$get = ['$filter', function ($filter) {\n var noUnsafeEval = csp().noUnsafeEval;\n var $parseOptions = {\n csp: noUnsafeEval,\n literals: copy(literals),\n isIdentifierStart: isFunction(identStart) && identStart,\n isIdentifierContinue: isFunction(identContinue) && identContinue\n };\n $parse.$$getAst = $$getAst;\n return $parse;\n function $parse(exp, interceptorFn) {\n var parsedExpression, cacheKey;\n switch (typeof exp) {\n case 'string':\n exp = exp.trim();\n cacheKey = exp;\n parsedExpression = cache[cacheKey];\n if (!parsedExpression) {\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n parsedExpression = parser.parse(exp);\n cache[cacheKey] = addWatchDelegate(parsedExpression);\n }\n return addInterceptor(parsedExpression, interceptorFn);\n case 'function':\n return addInterceptor(exp, interceptorFn);\n default:\n return addInterceptor(noop, interceptorFn);\n }\n }\n function $$getAst(exp) {\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n return parser.getAst(exp).ast;\n }\n function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) {\n if (newValue == null || oldValueOfValue == null) {\n // null/undefined\n return newValue === oldValueOfValue;\n }\n if (typeof newValue === 'object') {\n // attempt to convert the value to a primitive type\n // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n // be cheaply dirty-checked\n newValue = getValueOf(newValue);\n if (typeof newValue === 'object' && !compareObjectIdentity) {\n // objects/arrays are not supported - deep-watching them would be too expensive\n return false;\n }\n\n // fall-through to the primitive equality check\n }\n\n //Primitive or NaN\n // eslint-disable-next-line no-self-compare\n return newValue === oldValueOfValue || newValue !== newValue && oldValueOfValue !== oldValueOfValue;\n }\n function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var inputExpressions = parsedExpression.inputs;\n var lastResult;\n if (inputExpressions.length === 1) {\n var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n inputExpressions = inputExpressions[0];\n return scope.$watch(function expressionInputWatch(scope) {\n var newInputValue = inputExpressions(scope);\n if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, inputExpressions.isPure)) {\n lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);\n oldInputValueOf = newInputValue && getValueOf(newInputValue);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n var oldInputValueOfValues = [];\n var oldInputValues = [];\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n oldInputValues[i] = null;\n }\n return scope.$watch(function expressionInputsWatch(scope) {\n var changed = false;\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n var newInputValue = inputExpressions[i](scope);\n if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], inputExpressions[i].isPure))) {\n oldInputValues[i] = newInputValue;\n oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n }\n }\n if (changed) {\n lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var isDone = parsedExpression.literal ? isAllDefined : isDefined;\n var unwatch, lastValue;\n var exp = parsedExpression.$$intercepted || parsedExpression;\n var post = parsedExpression.$$interceptor || identity;\n var useInputs = parsedExpression.inputs && !exp.inputs;\n\n // Propagate the literal/inputs/constant attributes\n // ... but not oneTime since we are handling it\n oneTimeWatch.literal = parsedExpression.literal;\n oneTimeWatch.constant = parsedExpression.constant;\n oneTimeWatch.inputs = parsedExpression.inputs;\n\n // Allow other delegates to run on this wrapped expression\n addWatchDelegate(oneTimeWatch);\n unwatch = scope.$watch(oneTimeWatch, listener, objectEquality, prettyPrintExpression);\n return unwatch;\n function unwatchIfDone() {\n if (isDone(lastValue)) {\n unwatch();\n }\n }\n function oneTimeWatch(scope, locals, assign, inputs) {\n lastValue = useInputs && inputs ? inputs[0] : exp(scope, locals, assign, inputs);\n if (isDone(lastValue)) {\n scope.$$postDigest(unwatchIfDone);\n }\n return post(lastValue);\n }\n }\n function isAllDefined(value) {\n var allDefined = true;\n forEach(value, function (val) {\n if (!isDefined(val)) allDefined = false;\n });\n return allDefined;\n }\n function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch = scope.$watch(function constantWatch(scope) {\n unwatch();\n return parsedExpression(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n function addWatchDelegate(parsedExpression) {\n if (parsedExpression.constant) {\n parsedExpression.$$watchDelegate = constantWatchDelegate;\n } else if (parsedExpression.oneTime) {\n parsedExpression.$$watchDelegate = oneTimeWatchDelegate;\n } else if (parsedExpression.inputs) {\n parsedExpression.$$watchDelegate = inputsWatchDelegate;\n }\n return parsedExpression;\n }\n function chainInterceptors(first, second) {\n function chainedInterceptor(value) {\n return second(first(value));\n }\n chainedInterceptor.$stateful = first.$stateful || second.$stateful;\n chainedInterceptor.$$pure = first.$$pure && second.$$pure;\n return chainedInterceptor;\n }\n function addInterceptor(parsedExpression, interceptorFn) {\n if (!interceptorFn) return parsedExpression;\n\n // Extract any existing interceptors out of the parsedExpression\n // to ensure the original parsedExpression is always the $$intercepted\n if (parsedExpression.$$interceptor) {\n interceptorFn = chainInterceptors(parsedExpression.$$interceptor, interceptorFn);\n parsedExpression = parsedExpression.$$intercepted;\n }\n var useInputs = false;\n var fn = function interceptedExpression(scope, locals, assign, inputs) {\n var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);\n return interceptorFn(value);\n };\n\n // Maintain references to the interceptor/intercepted\n fn.$$intercepted = parsedExpression;\n fn.$$interceptor = interceptorFn;\n\n // Propagate the literal/oneTime/constant attributes\n fn.literal = parsedExpression.literal;\n fn.oneTime = parsedExpression.oneTime;\n fn.constant = parsedExpression.constant;\n\n // Treat the interceptor like filters.\n // If it is not $stateful then only watch its inputs.\n // If the expression itself has no inputs then use the full expression as an input.\n if (!interceptorFn.$stateful) {\n useInputs = !parsedExpression.inputs;\n fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];\n if (!interceptorFn.$$pure) {\n fn.inputs = fn.inputs.map(function (e) {\n // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a\n // non-pure interceptor function.\n if (e.isPure === PURITY_RELATIVE) {\n return function depurifier(s) {\n return e(s);\n };\n }\n return e;\n });\n }\n }\n return addWatchDelegate(fn);\n }\n }];\n }\n\n /**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is a [Promises/A+](https://promisesaplus.com/)-compliant implementation of promises/deferred\n * objects inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 (ES2015) promises to some degree.\n *\n * ## $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * // perform some asynchronous operation, resolve or reject the promise when appropriate.\n * return $q(function(resolve, reject) {\n * setTimeout(function() {\n * if (okToGreet(name)) {\n * resolve('Hello, ' + name + '!');\n * } else {\n * reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n * });\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * var deferred = $q.defer();\n *\n * setTimeout(function() {\n * deferred.notify('About to greet ' + name + '.');\n *\n * if (okToGreet(name)) {\n * deferred.resolve('Hello, ' + name + '!');\n * } else {\n * deferred.reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n *\n * return deferred.promise;\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * }, function(update) {\n * alert('Got notification: ' + update);\n * });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * ## The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n * constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n * resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n * multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * ## The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or\n * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n * as soon as the result is available. The callbacks are called with a single argument: the result\n * or rejection reason. Additionally, the notify callback may be called zero or more times to\n * provide a progress indication, before the promise is resolved or rejected.\n *\n * This method *returns a new promise* which is resolved or rejected via the return value of the\n * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved\n * with the value which is resolved in that promise using\n * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).\n * It also notifies via the return value of the `notifyCallback` method. The promise cannot be\n * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback\n * arguments are optional.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n * but to do so without modifying the final value. This is useful to release resources or do some\n * clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n * more information.\n *\n * ## Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * return result + 1;\n * });\n *\n * // promiseB will be resolved immediately after promiseA is resolved and its value\n * // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * ## Differences between Kris Kowal's Q and $q\n *\n * There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n * mechanism in AngularJS, which means faster propagation of resolution or rejection into your\n * models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n * all the important functionality needed for common async tasks.\n *\n * ## Testing\n *\n * ```js\n * it('should simulate promise', inject(function($q, $rootScope) {\n * var deferred = $q.defer();\n * var promise = deferred.promise;\n * var resolvedValue;\n *\n * promise.then(function(value) { resolvedValue = value; });\n * expect(resolvedValue).toBeUndefined();\n *\n * // Simulate resolving of promise\n * deferred.resolve(123);\n * // Note that the 'then' function does not get called synchronously.\n * // This is because we want the promise API to always be async, whether or not\n * // it got called synchronously or asynchronously.\n * expect(resolvedValue).toBeUndefined();\n *\n * // Propagate promise resolution to 'then' functions using $apply().\n * $rootScope.$apply();\n * expect(resolvedValue).toEqual(123);\n * }));\n * ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n * rejecting the newly created promise. The first parameter is a function which resolves the\n * promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\n /**\n * @ngdoc provider\n * @name $qProvider\n * @this\n *\n * @description\n */\n function $QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$rootScope', '$exceptionHandler', function ($rootScope, $exceptionHandler) {\n return qFactory(function (callback) {\n $rootScope.$evalAsync(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n\n /**\n * @ngdoc method\n * @name $qProvider#errorOnUnhandledRejections\n * @kind function\n *\n * @description\n * Retrieves or overrides whether to generate an error when a rejected promise is not handled.\n * This feature is enabled by default.\n *\n * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.\n * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for\n * chaining otherwise.\n */\n this.errorOnUnhandledRejections = function (value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n }\n\n /** @this */\n function $$QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$browser', '$exceptionHandler', function ($browser, $exceptionHandler) {\n return qFactory(function (callback) {\n $browser.defer(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n this.errorOnUnhandledRejections = function (value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n }\n\n /**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n * debugging purposes.\n * @param {boolean=} errorOnUnhandledRejections Whether an error should be generated on unhandled\n * promises rejections.\n * @returns {object} Promise manager.\n */\n function qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {\n var $qMinErr = minErr('$q', TypeError);\n var queueSize = 0;\n var checkQueue = [];\n\n /**\n * @ngdoc method\n * @name ng.$q#defer\n * @kind function\n *\n * @description\n * Creates a `Deferred` object which represents a task which will finish in the future.\n *\n * @returns {Deferred} Returns a new instance of deferred.\n */\n function defer() {\n return new Deferred();\n }\n function Deferred() {\n var promise = this.promise = new Promise();\n //Non prototype methods necessary to support unbound execution :/\n this.resolve = function (val) {\n resolvePromise(promise, val);\n };\n this.reject = function (reason) {\n rejectPromise(promise, reason);\n };\n this.notify = function (progress) {\n notifyPromise(promise, progress);\n };\n }\n function Promise() {\n this.$$state = {\n status: 0\n };\n }\n extend(Promise.prototype, {\n then: function (onFulfilled, onRejected, progressBack) {\n if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {\n return this;\n }\n var result = new Promise();\n this.$$state.pending = this.$$state.pending || [];\n this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n return result;\n },\n 'catch': function (callback) {\n return this.then(null, callback);\n },\n 'finally': function (callback, progressBack) {\n return this.then(function (value) {\n return handleCallback(value, resolve, callback);\n }, function (error) {\n return handleCallback(error, reject, callback);\n }, progressBack);\n }\n });\n function processQueue(state) {\n var fn, promise, pending;\n pending = state.pending;\n state.processScheduled = false;\n state.pending = undefined;\n try {\n for (var i = 0, ii = pending.length; i < ii; ++i) {\n markQStateExceptionHandled(state);\n promise = pending[i][0];\n fn = pending[i][state.status];\n try {\n if (isFunction(fn)) {\n resolvePromise(promise, fn(state.value));\n } else if (state.status === 1) {\n resolvePromise(promise, state.value);\n } else {\n rejectPromise(promise, state.value);\n }\n } catch (e) {\n rejectPromise(promise, e);\n // This error is explicitly marked for being passed to the $exceptionHandler\n if (e && e.$$passToExceptionHandler === true) {\n exceptionHandler(e);\n }\n }\n }\n } finally {\n --queueSize;\n if (errorOnUnhandledRejections && queueSize === 0) {\n nextTick(processChecks);\n }\n }\n }\n function processChecks() {\n // eslint-disable-next-line no-unmodified-loop-condition\n while (!queueSize && checkQueue.length) {\n var toCheck = checkQueue.shift();\n if (!isStateExceptionHandled(toCheck)) {\n markQStateExceptionHandled(toCheck);\n var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);\n if (isError(toCheck.value)) {\n exceptionHandler(toCheck.value, errorMessage);\n } else {\n exceptionHandler(errorMessage);\n }\n }\n }\n }\n function scheduleProcessQueue(state) {\n if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) {\n if (queueSize === 0 && checkQueue.length === 0) {\n nextTick(processChecks);\n }\n checkQueue.push(state);\n }\n if (state.processScheduled || !state.pending) return;\n state.processScheduled = true;\n ++queueSize;\n nextTick(function () {\n processQueue(state);\n });\n }\n function resolvePromise(promise, val) {\n if (promise.$$state.status) return;\n if (val === promise) {\n $$reject(promise, $qMinErr('qcycle', 'Expected promise to be resolved with value other than itself \\'{0}\\'', val));\n } else {\n $$resolve(promise, val);\n }\n }\n function $$resolve(promise, val) {\n var then;\n var done = false;\n try {\n if (isObject(val) || isFunction(val)) then = val.then;\n if (isFunction(then)) {\n promise.$$state.status = -1;\n then.call(val, doResolve, doReject, doNotify);\n } else {\n promise.$$state.value = val;\n promise.$$state.status = 1;\n scheduleProcessQueue(promise.$$state);\n }\n } catch (e) {\n doReject(e);\n }\n function doResolve(val) {\n if (done) return;\n done = true;\n $$resolve(promise, val);\n }\n function doReject(val) {\n if (done) return;\n done = true;\n $$reject(promise, val);\n }\n function doNotify(progress) {\n notifyPromise(promise, progress);\n }\n }\n function rejectPromise(promise, reason) {\n if (promise.$$state.status) return;\n $$reject(promise, reason);\n }\n function $$reject(promise, reason) {\n promise.$$state.value = reason;\n promise.$$state.status = 2;\n scheduleProcessQueue(promise.$$state);\n }\n function notifyPromise(promise, progress) {\n var callbacks = promise.$$state.pending;\n if (promise.$$state.status <= 0 && callbacks && callbacks.length) {\n nextTick(function () {\n var callback, result;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n result = callbacks[i][0];\n callback = callbacks[i][3];\n try {\n notifyPromise(result, isFunction(callback) ? callback(progress) : progress);\n } catch (e) {\n exceptionHandler(e);\n }\n }\n });\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#reject\n * @kind function\n *\n * @description\n * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n * a promise chain, you don't need to worry about it.\n *\n * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n * a promise error callback and you want to forward the error to the promise derived from the\n * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n * `reject`.\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * // success: do something and resolve promiseB\n * // with the old or a new result\n * return result;\n * }, function(reason) {\n * // error: handle the error if possible and\n * // resolve promiseB with newPromiseOrValue,\n * // otherwise forward the rejection to promiseB\n * if (canHandle(reason)) {\n * // handle the error and recover\n * return newPromiseOrValue;\n * }\n * return $q.reject(reason);\n * });\n * ```\n *\n * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n */\n function reject(reason) {\n var result = new Promise();\n rejectPromise(result, reason);\n return result;\n }\n function handleCallback(value, resolver, callback) {\n var callbackOutput = null;\n try {\n if (isFunction(callback)) callbackOutput = callback();\n } catch (e) {\n return reject(e);\n }\n if (isPromiseLike(callbackOutput)) {\n return callbackOutput.then(function () {\n return resolver(value);\n }, reject);\n } else {\n return resolver(value);\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#when\n * @kind function\n *\n * @description\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n * This is useful when you are dealing with an object that might or might not be a promise, or if\n * the promise comes from a source that can't be trusted.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n\n function when(value, callback, errback, progressBack) {\n var result = new Promise();\n resolvePromise(result, value);\n return result.then(callback, errback, progressBack);\n }\n\n /**\n * @ngdoc method\n * @name $q#resolve\n * @kind function\n *\n * @description\n * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n var resolve = when;\n\n /**\n * @ngdoc method\n * @name $q#all\n * @kind function\n *\n * @description\n * Combines multiple promises into a single promise that is resolved when all of the input\n * promises are resolved.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n * each value corresponding to the promise at the same index/key in the `promises` array/hash.\n * If any of the promises is resolved with a rejection, this resulting promise will be rejected\n * with the same rejection value.\n */\n\n function all(promises) {\n var result = new Promise(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n forEach(promises, function (promise, key) {\n counter++;\n when(promise).then(function (value) {\n results[key] = value;\n if (! --counter) resolvePromise(result, results);\n }, function (reason) {\n rejectPromise(result, reason);\n });\n });\n if (counter === 0) {\n resolvePromise(result, results);\n }\n return result;\n }\n\n /**\n * @ngdoc method\n * @name $q#race\n * @kind function\n *\n * @description\n * Returns a promise that resolves or rejects as soon as one of those promises\n * resolves or rejects, with the value or reason from that promise.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises`\n * resolves or rejects, with the value or reason from that promise.\n */\n\n function race(promises) {\n var deferred = defer();\n forEach(promises, function (promise) {\n when(promise).then(deferred.resolve, deferred.reject);\n });\n return deferred.promise;\n }\n function $Q(resolver) {\n if (!isFunction(resolver)) {\n throw $qMinErr('norslvr', 'Expected resolverFn, got \\'{0}\\'', resolver);\n }\n var promise = new Promise();\n function resolveFn(value) {\n resolvePromise(promise, value);\n }\n function rejectFn(reason) {\n rejectPromise(promise, reason);\n }\n resolver(resolveFn, rejectFn);\n return promise;\n }\n\n // Let's make the instanceof operator work for promises, so that\n // `new $q(fn) instanceof $q` would evaluate to true.\n $Q.prototype = Promise.prototype;\n $Q.defer = defer;\n $Q.reject = reject;\n $Q.when = when;\n $Q.resolve = resolve;\n $Q.all = all;\n $Q.race = race;\n return $Q;\n }\n function isStateExceptionHandled(state) {\n return !!state.pur;\n }\n function markQStateExceptionHandled(state) {\n state.pur = true;\n }\n function markQExceptionHandled(q) {\n // Built-in `$q` promises will always have a `$$state` property. This check is to allow\n // overwriting `$q` with a different promise library (e.g. Bluebird + angular-bluebird-promises).\n // (Currently, this is the only method that might be called with a promise, even if it is not\n // created by the built-in `$q`.)\n if (q.$$state) {\n markQStateExceptionHandled(q.$$state);\n }\n }\n\n /** @this */\n function $$RAFProvider() {\n //rAF\n this.$get = ['$window', '$timeout', function ($window, $timeout) {\n var requestAnimationFrame = $window.requestAnimationFrame || $window.webkitRequestAnimationFrame;\n var cancelAnimationFrame = $window.cancelAnimationFrame || $window.webkitCancelAnimationFrame || $window.webkitCancelRequestAnimationFrame;\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported ? function (fn) {\n var id = requestAnimationFrame(fn);\n return function () {\n cancelAnimationFrame(id);\n };\n } : function (fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function () {\n $timeout.cancel(timer);\n };\n };\n raf.supported = rafSupported;\n return raf;\n }];\n }\n\n /**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n * - No closures, instead use prototypical inheritance for API\n * - Internal state needs to be stored on scope directly, which means that private state is\n * exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n * - This means that in order to keep the same order of execution as addition we have to add\n * items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists\n *\n * There are fewer watches than observers. This is why you don't want the observer to be implemented\n * in the same way as watch. Watch requires return of the initialization function which is expensive\n * to construct.\n */\n\n /**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n /**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n /**\n * @ngdoc service\n * @name $rootScope\n * @this\n *\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\n function $RootScopeProvider() {\n var TTL = 10;\n var $rootScopeMinErr = minErr('$rootScope');\n var lastDirtyWatch = null;\n var applyAsyncId = null;\n this.digestTtl = function (value) {\n if (arguments.length) {\n TTL = value;\n }\n return TTL;\n };\n function createChildScopeClass(parent) {\n function ChildScope() {\n this.$$watchers = this.$$nextSibling = this.$$childHead = this.$$childTail = null;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$id = nextUid();\n this.$$ChildScope = null;\n this.$$suspended = false;\n }\n ChildScope.prototype = parent;\n return ChildScope;\n }\n this.$get = ['$exceptionHandler', '$parse', '$browser', function ($exceptionHandler, $parse, $browser) {\n function destroyChildScope($event) {\n $event.currentScope.$$destroyed = true;\n }\n function cleanUpScope($scope) {\n // Support: IE 9 only\n if (msie === 9) {\n // There is a memory leak in IE9 if all child scopes are not disconnected\n // completely when a scope is destroyed. So this code will recurse up through\n // all this scopes children\n //\n // See issue https://github.com/angular/angular.js/issues/10706\n if ($scope.$$childHead) {\n cleanUpScope($scope.$$childHead);\n }\n if ($scope.$$nextSibling) {\n cleanUpScope($scope.$$nextSibling);\n }\n }\n\n // The code below works around IE9 and V8's memory leaks\n //\n // See:\n // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead = $scope.$$childTail = $scope.$root = $scope.$$watchers = null;\n }\n\n /**\n * @ngdoc type\n * @name $rootScope.Scope\n *\n * @description\n * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n * {@link auto.$injector $injector}. Child scopes are created using the\n * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for\n * an in-depth introduction and usage examples.\n *\n *\n * ## Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * ```js\n var parent = $rootScope;\n var child = parent.$new();\n parent.salutation = \"Hello\";\n expect(child.salutation).toEqual('Hello');\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * ```\n *\n * When interacting with `Scope` in tests, additional helper methods are available on the\n * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n * details.\n *\n *\n * @param {Object.=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.=} instanceCache Provides pre-instantiated services which should\n * append/override services provided by `providers`. This is handy\n * when unit-testing and having the need to override a default\n * service.\n * @returns {Object} Newly created scope.\n *\n */\n function Scope() {\n this.$id = nextUid();\n this.$$phase = this.$parent = this.$$watchers = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = null;\n this.$root = this;\n this.$$destroyed = false;\n this.$$suspended = false;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$$isolateBindings = null;\n }\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$id\n *\n * @description\n * Unique scope ID (monotonically increasing) useful for debugging.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$parent\n *\n * @description\n * Reference to the parent scope.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$root\n *\n * @description\n * Reference to the root scope.\n */\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$new\n * @kind function\n *\n * @description\n * Creates a new child {@link ng.$rootScope.Scope scope}.\n *\n * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n * desired for the scope and its child scopes to be permanently detached from the parent and\n * thus stop participating in model change detection and listener notification by invoking.\n *\n * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n * parent scope. The scope is isolated, as it can not see parent scope properties.\n * When creating widgets, it is useful for the widget to not accidentally read parent\n * state.\n *\n * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n * of the newly created scope. Defaults to `this` scope if not provided.\n * This is used when creating a transclude scope to correctly place it\n * in the scope hierarchy while maintaining the correct prototypical\n * inheritance.\n *\n * @returns {Object} The newly created child scope.\n *\n */\n $new: function (isolate, parent) {\n var child;\n parent = parent || this;\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n } else {\n // Only create a child scope class if somebody asks for one,\n // but cache it to allow the VM to optimize lookups.\n if (!this.$$ChildScope) {\n this.$$ChildScope = createChildScopeClass(this);\n }\n child = new this.$$ChildScope();\n }\n child.$parent = parent;\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n\n // When the new scope is not isolated or we inherit from `this`, and\n // the parent scope is destroyed, the property `$$destroyed` is inherited\n // prototypically. In all other cases, this property needs to be set\n // when the parent scope is destroyed.\n // The listener needs to be added after the parent is set\n if (isolate || parent !== this) child.$on('$destroy', destroyChildScope);\n return child;\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watch\n * @kind function\n *\n * @description\n * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n *\n * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n * $digest()} and should return the value that will be watched. (`watchExpression` should not change\n * its value when executed multiple times with the same input because it may be executed multiple\n * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be\n * [idempotent](http://en.wikipedia.org/wiki/Idempotence).)\n * - The `listener` is called only when the value from the current `watchExpression` and the\n * previous call to `watchExpression` are not equal (with the exception of the initial run,\n * see below). Inequality is determined according to reference inequality,\n * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n * via the `!==` Javascript operator, unless `objectEquality == true`\n * (see next point)\n * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n * according to the {@link angular.equals} function. To save the value of the object for\n * later comparison, the {@link angular.copy} function is used. This therefore means that\n * watching complex objects will have adverse memory and performance implications.\n * - This should not be used to watch for changes in objects that are (or contain)\n * [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}.\n * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n * This is achieved by rerunning the watchers until no changes are detected. The rerun\n * iteration limit is 10 to prevent an infinite loop deadlock.\n *\n *\n * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n * you can register a `watchExpression` function with no `listener`. (Be prepared for\n * multiple calls to your `watchExpression` because it will execute multiple times in a\n * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)\n *\n * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n * watcher. In rare cases, this is undesirable because the listener is called when the result\n * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n * listener was called due to initialization.\n *\n *\n *\n * @example\n * ```js\n // let's assume that scope was dependency injected as the $rootScope\n var scope = $rootScope;\n scope.name = 'misko';\n scope.counter = 0;\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n // Using a function as a watchExpression\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This function returns the value being watched. It is called for each turn of the $digest loop\n function() { return food; },\n // This is the change listener, called when the value returned from the above function changes\n function(newValue, oldValue) {\n if ( newValue !== oldValue ) {\n // Only increment the counter if the value changed\n scope.foodCounter = scope.foodCounter + 1;\n }\n }\n );\n // No digest has been run so the counter will be zero\n expect(scope.foodCounter).toEqual(0);\n // Run the digest but since food has not changed count will still be zero\n scope.$digest();\n expect(scope.foodCounter).toEqual(0);\n // Update food and run digest. Now the counter will increment\n food = 'cheeseburger';\n scope.$digest();\n expect(scope.foodCounter).toEqual(1);\n * ```\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n * a call to the `listener`.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(scope)`: called with current `scope` as a parameter.\n * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n * of `watchExpression` changes.\n *\n * - `newVal` contains the current value of the `watchExpression`\n * - `oldVal` contains the previous value of the `watchExpression`\n * - `scope` refers to the current scope\n * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of\n * comparing for reference equality.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function (watchExp, listener, objectEquality, prettyPrintExpression) {\n var get = $parse(watchExp);\n var fn = isFunction(listener) ? listener : noop;\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, fn, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: fn,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n lastDirtyWatch = null;\n if (!array) {\n array = scope.$$watchers = [];\n array.$$digestWatchIndex = -1;\n }\n // we use unshift since we use a while loop in $digest for speed.\n // the while loop reads in reverse order.\n array.unshift(watcher);\n array.$$digestWatchIndex++;\n incrementWatchersCount(this, 1);\n return function deregisterWatch() {\n var index = arrayRemove(array, watcher);\n if (index >= 0) {\n incrementWatchersCount(scope, -1);\n if (index < array.$$digestWatchIndex) {\n array.$$digestWatchIndex--;\n }\n }\n lastDirtyWatch = null;\n };\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchGroup\n * @kind function\n *\n * @description\n * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n * If any one expression in the collection changes the `listener` is executed.\n *\n * - The items in the `watchExpressions` array are observed via the standard `$watch` operation. Their return\n * values are examined for changes on every call to `$digest`.\n * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n *\n * @param {Array.} watchExpressions Array of expressions that will be individually\n * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n *\n * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n * expression in `watchExpressions` changes\n * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * The `scope` refers to the current scope.\n * @returns {function()} Returns a de-registration function for all listeners.\n */\n $watchGroup: function (watchExpressions, listener) {\n var oldValues = new Array(watchExpressions.length);\n var newValues = new Array(watchExpressions.length);\n var deregisterFns = [];\n var self = this;\n var changeReactionScheduled = false;\n var firstRun = true;\n if (!watchExpressions.length) {\n // No expressions means we call the listener ASAP\n var shouldCall = true;\n self.$evalAsync(function () {\n if (shouldCall) listener(newValues, newValues, self);\n });\n return function deregisterWatchGroup() {\n shouldCall = false;\n };\n }\n if (watchExpressions.length === 1) {\n // Special case size of one\n return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n newValues[0] = value;\n oldValues[0] = oldValue;\n listener(newValues, value === oldValue ? newValues : oldValues, scope);\n });\n }\n forEach(watchExpressions, function (expr, i) {\n var unwatchFn = self.$watch(expr, function watchGroupSubAction(value) {\n newValues[i] = value;\n if (!changeReactionScheduled) {\n changeReactionScheduled = true;\n self.$evalAsync(watchGroupAction);\n }\n });\n deregisterFns.push(unwatchFn);\n });\n function watchGroupAction() {\n changeReactionScheduled = false;\n try {\n if (firstRun) {\n firstRun = false;\n listener(newValues, newValues, self);\n } else {\n listener(newValues, oldValues, self);\n }\n } finally {\n for (var i = 0; i < watchExpressions.length; i++) {\n oldValues[i] = newValues[i];\n }\n }\n }\n return function deregisterWatchGroup() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n };\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchCollection\n * @kind function\n *\n * @description\n * Shallow watches the properties of an object and fires whenever any of the properties change\n * (for arrays, this implies watching the array items; for object maps, this implies watching\n * the properties). If a change is detected, the `listener` callback is fired.\n *\n * - The `obj` collection is observed via standard $watch operation and is examined on every\n * call to $digest() to see if any items have been added, removed, or moved.\n * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n * adding, removing, and moving items belonging to an object or array.\n *\n *\n * @example\n * ```js\n $scope.names = ['igor', 'matias', 'misko', 'james'];\n $scope.dataCount = 4;\n $scope.$watchCollection('names', function(newNames, oldNames) {\n $scope.dataCount = newNames.length;\n });\n expect($scope.dataCount).toEqual(4);\n $scope.$digest();\n //still at 4 ... no changes\n expect($scope.dataCount).toEqual(4);\n $scope.names.pop();\n $scope.$digest();\n //now there's been a change\n expect($scope.dataCount).toEqual(3);\n * ```\n *\n *\n * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n * expression value should evaluate to an object or an array which is observed on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n * collection will trigger a call to the `listener`.\n *\n * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n * when a change is detected.\n * - The `newCollection` object is the newly modified data obtained from the `obj` expression\n * - The `oldCollection` object is a copy of the former collection data.\n * Due to performance considerations, the`oldCollection` value is computed only if the\n * `listener` function declares two or more arguments.\n * - The `scope` argument refers to the current scope.\n *\n * @returns {function()} Returns a de-registration function for this listener. When the\n * de-registration function is executed, the internal watch operation is terminated.\n */\n $watchCollection: function (obj, listener) {\n // Mark the interceptor as\n // ... $$pure when literal since the instance will change when any input changes\n $watchCollectionInterceptor.$$pure = $parse(obj).literal;\n // ... $stateful when non-literal since we must read the state of the collection\n $watchCollectionInterceptor.$stateful = !$watchCollectionInterceptor.$$pure;\n var self = this;\n // the current value, updated on each dirty-check run\n var newValue;\n // a shallow copy of the newValue from the last dirty-check run,\n // updated to match newValue during dirty-check run\n var oldValue;\n // a shallow copy of the newValue from when the last change happened\n var veryOldValue;\n // only track veryOldValue if the listener is asking for it\n var trackVeryOldValue = listener.length > 1;\n var changeDetected = 0;\n var changeDetector = $parse(obj, $watchCollectionInterceptor);\n var internalArray = [];\n var internalObject = {};\n var initRun = true;\n var oldLength = 0;\n function $watchCollectionInterceptor(_value) {\n newValue = _value;\n var newLength, key, bothNaN, newItem, oldItem;\n\n // If the new value is undefined, then return undefined as the watch may be a one-time watch\n if (isUndefined(newValue)) return;\n if (!isObject(newValue)) {\n // if primitive\n if (oldValue !== newValue) {\n oldValue = newValue;\n changeDetected++;\n }\n } else if (isArrayLike(newValue)) {\n if (oldValue !== internalArray) {\n // we are transitioning from something which was not an array into array.\n oldValue = internalArray;\n oldLength = oldValue.length = 0;\n changeDetected++;\n }\n newLength = newValue.length;\n if (oldLength !== newLength) {\n // if lengths do not match we need to trigger change notification\n changeDetected++;\n oldValue.length = oldLength = newLength;\n }\n // copy the items to oldValue and look for changes.\n for (var i = 0; i < newLength; i++) {\n oldItem = oldValue[i];\n newItem = newValue[i];\n\n // eslint-disable-next-line no-self-compare\n bothNaN = oldItem !== oldItem && newItem !== newItem;\n if (!bothNaN && oldItem !== newItem) {\n changeDetected++;\n oldValue[i] = newItem;\n }\n }\n } else {\n if (oldValue !== internalObject) {\n // we are transitioning from something which was not an object into object.\n oldValue = internalObject = {};\n oldLength = 0;\n changeDetected++;\n }\n // copy the items to oldValue and look for changes.\n newLength = 0;\n for (key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n newLength++;\n newItem = newValue[key];\n oldItem = oldValue[key];\n if (key in oldValue) {\n // eslint-disable-next-line no-self-compare\n bothNaN = oldItem !== oldItem && newItem !== newItem;\n if (!bothNaN && oldItem !== newItem) {\n changeDetected++;\n oldValue[key] = newItem;\n }\n } else {\n oldLength++;\n oldValue[key] = newItem;\n changeDetected++;\n }\n }\n }\n if (oldLength > newLength) {\n // we used to have more keys, need to find them and destroy them.\n changeDetected++;\n for (key in oldValue) {\n if (!hasOwnProperty.call(newValue, key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n function $watchCollectionAction() {\n if (initRun) {\n initRun = false;\n listener(newValue, newValue, self);\n } else {\n listener(newValue, veryOldValue, self);\n }\n\n // make a copy for the next time a collection is changed\n if (trackVeryOldValue) {\n if (!isObject(newValue)) {\n //primitive\n veryOldValue = newValue;\n } else if (isArrayLike(newValue)) {\n veryOldValue = new Array(newValue.length);\n for (var i = 0; i < newValue.length; i++) {\n veryOldValue[i] = newValue[i];\n }\n } else {\n // if object\n veryOldValue = {};\n for (var key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n veryOldValue[key] = newValue[key];\n }\n }\n }\n }\n }\n return this.$watch(changeDetector, $watchCollectionAction);\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$digest\n * @kind function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n * until no more listeners are firing. This means that it is possible to get into an infinite\n * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n * iterations exceeds 10.\n *\n * Usually, you don't call `$digest()` directly in\n * {@link ng.directive:ngController controllers} or in\n * {@link ng.$compileProvider#directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n *\n * If you want to be notified whenever `$digest()` is called,\n * you can register a `watchExpression` function with\n * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n *\n * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n *\n * @example\n * ```js\n var scope = ...;\n scope.name = 'misko';\n scope.counter = 0;\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n * ```\n *\n */\n $digest: function () {\n var watch,\n value,\n last,\n fn,\n get,\n watchers,\n dirty,\n ttl = TTL,\n next,\n current,\n target = asyncQueue.length ? $rootScope : this,\n watchLog = [],\n logIdx,\n asyncTask;\n beginPhase('$digest');\n // Check for changes to browser url that happened in sync before the call to $digest\n $browser.$$checkUrlChange();\n if (this === $rootScope && applyAsyncId !== null) {\n // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n $browser.defer.cancel(applyAsyncId);\n flushApplyAsync();\n }\n lastDirtyWatch = null;\n do {\n // \"while dirty\" loop\n dirty = false;\n current = target;\n\n // It's safe for asyncQueuePosition to be a local variable here because this loop can't\n // be reentered recursively. Calling $digest from a function passed to $evalAsync would\n // lead to a '$digest already in progress' error.\n for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {\n try {\n asyncTask = asyncQueue[asyncQueuePosition];\n fn = asyncTask.fn;\n fn(asyncTask.scope, asyncTask.locals);\n } catch (e) {\n $exceptionHandler(e);\n }\n lastDirtyWatch = null;\n }\n asyncQueue.length = 0;\n traverseScopesLoop: do {\n // \"traverse the scopes\" loop\n if (watchers = !current.$$suspended && current.$$watchers) {\n // process our watches\n watchers.$$digestWatchIndex = watchers.length;\n while (watchers.$$digestWatchIndex--) {\n try {\n watch = watchers[watchers.$$digestWatchIndex];\n // Most common watches are on primitives, in which case we can short\n // circuit it with === operator, only when === fails do we use .equals\n if (watch) {\n get = watch.get;\n if ((value = get(current)) !== (last = watch.last) && !(watch.eq ? equals(value, last) : isNumberNaN(value) && isNumberNaN(last))) {\n dirty = true;\n lastDirtyWatch = watch;\n watch.last = watch.eq ? copy(value, null) : value;\n fn = watch.fn;\n fn(value, last === initWatchVal ? value : last, current);\n if (ttl < 5) {\n logIdx = 4 - ttl;\n if (!watchLog[logIdx]) watchLog[logIdx] = [];\n watchLog[logIdx].push({\n msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n newVal: value,\n oldVal: last\n });\n }\n } else if (watch === lastDirtyWatch) {\n // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n // have already been tested.\n dirty = false;\n break traverseScopesLoop;\n }\n }\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $broadcast\n // (though it differs due to having the extra check for $$suspended and does not\n // check $$listenerCount)\n if (!(next = !current.$$suspended && current.$$watchersCount && current.$$childHead || current !== target && current.$$nextSibling)) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while (current = next);\n\n // `break traverseScopesLoop;` takes us to here\n\n if ((dirty || asyncQueue.length) && !ttl--) {\n clearPhase();\n throw $rootScopeMinErr('infdig', '{0} $digest() iterations reached. Aborting!\\n' + 'Watchers fired in the last 5 iterations: {1}', TTL, watchLog);\n }\n } while (dirty || asyncQueue.length);\n clearPhase();\n\n // postDigestQueuePosition isn't local here because this loop can be reentered recursively.\n while (postDigestQueuePosition < postDigestQueue.length) {\n try {\n postDigestQueue[postDigestQueuePosition++]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n postDigestQueue.length = postDigestQueuePosition = 0;\n\n // Check for changes to browser url that happened during the $digest\n // (for which no event is fired; e.g. via `history.pushState()`)\n $browser.$$checkUrlChange();\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$suspend\n * @kind function\n *\n * @description\n * Suspend watchers of this scope subtree so that they will not be invoked during digest.\n *\n * This can be used to optimize your application when you know that running those watchers\n * is redundant.\n *\n * **Warning**\n *\n * Suspending scopes from the digest cycle can have unwanted and difficult to debug results.\n * Only use this approach if you are confident that you know what you are doing and have\n * ample tests to ensure that bindings get updated as you expect.\n *\n * Some of the things to consider are:\n *\n * * Any external event on a directive/component will not trigger a digest while the hosting\n * scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`.\n * * Transcluded content exists on a scope that inherits from outside a directive but exists\n * as a child of the directive's containing scope. If the containing scope is suspended the\n * transcluded scope will also be suspended, even if the scope from which the transcluded\n * scope inherits is not suspended.\n * * Multiple directives trying to manage the suspended status of a scope can confuse each other:\n * * A call to `$suspend()` on an already suspended scope is a no-op.\n * * A call to `$resume()` on a non-suspended scope is a no-op.\n * * If two directives suspend a scope, then one of them resumes the scope, the scope will no\n * longer be suspended. This could result in the other directive believing a scope to be\n * suspended when it is not.\n * * If a parent scope is suspended then all its descendants will be also excluded from future\n * digests whether or not they have been suspended themselves. Note that this also applies to\n * isolate child scopes.\n * * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers\n * for that scope and its descendants. When digesting we only check whether the current scope is\n * locally suspended, rather than checking whether it has a suspended ancestor.\n * * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be\n * included in future digests until all its ancestors have been resumed.\n * * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()`\n * against the `$rootScope` and so will still trigger a global digest even if the promise was\n * initiated by a component that lives on a suspended scope.\n */\n $suspend: function () {\n this.$$suspended = true;\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$isSuspended\n * @kind function\n *\n * @description\n * Call this method to determine if this scope has been explicitly suspended. It will not\n * tell you whether an ancestor has been suspended.\n * To determine if this scope will be excluded from a digest triggered at the $rootScope,\n * for example, you must check all its ancestors:\n *\n * ```\n * function isExcludedFromDigest(scope) {\n * while(scope) {\n * if (scope.$isSuspended()) return true;\n * scope = scope.$parent;\n * }\n * return false;\n * ```\n *\n * Be aware that a scope may not be included in digests if it has a suspended ancestor,\n * even if `$isSuspended()` returns false.\n *\n * @returns true if the current scope has been suspended.\n */\n $isSuspended: function () {\n return this.$$suspended;\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$resume\n * @kind function\n *\n * @description\n * Resume watchers of this scope subtree in case it was suspended.\n *\n * See {@link $rootScope.Scope#$suspend} for information about the dangers of using this approach.\n */\n $resume: function () {\n this.$$suspended = false;\n },\n /**\n * @ngdoc event\n * @name $rootScope.Scope#$destroy\n * @eventType broadcast on scope being destroyed\n *\n * @description\n * Broadcasted when a scope and its children are being destroyed.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$destroy\n * @kind function\n *\n * @description\n * Removes the current scope (and all of its children) from the parent scope. Removal implies\n * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n * propagate to the current scope and its children. Removal also implies that the current\n * scope is eligible for garbage collection.\n *\n * The `$destroy()` is usually used by directives such as\n * {@link ng.directive:ngRepeat ngRepeat} for managing the\n * unrolling of the loop.\n *\n * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n * Application code can register a `$destroy` event handler that will give it a chance to\n * perform any necessary cleanup.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n $destroy: function () {\n // We can't destroy a scope that has been already destroyed.\n if (this.$$destroyed) return;\n var parent = this.$parent;\n this.$broadcast('$destroy');\n this.$$destroyed = true;\n if (this === $rootScope) {\n //Remove handlers attached to window when $rootScope is removed\n $browser.$$applicationDestroyed();\n }\n incrementWatchersCount(this, -this.$$watchersCount);\n for (var eventName in this.$$listenerCount) {\n decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n }\n\n // sever all the references to parent scopes (after this cleanup, the current scope should\n // not be retained by any of our references and should be eligible for garbage collection)\n if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling;\n if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling;\n if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n // Disable listeners, watchers and apply/digest methods\n this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n this.$on = this.$watch = this.$watchGroup = function () {\n return noop;\n };\n this.$$listeners = {};\n\n // Disconnect the next sibling to prevent `cleanUpScope` destroying those too\n this.$$nextSibling = null;\n cleanUpScope(this);\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$eval\n * @kind function\n *\n * @description\n * Executes the `expression` on the current scope and returns the result. Any exceptions in\n * the expression are propagated (uncaught). This is useful when evaluating AngularJS\n * expressions.\n *\n * @example\n * ```js\n var scope = ng.$rootScope.Scope();\n scope.a = 1;\n scope.b = 2;\n expect(scope.$eval('a+b')).toEqual(3);\n expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n * ```\n *\n * @param {(string|function())=} expression An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n * @returns {*} The result of evaluating the expression.\n */\n $eval: function (expr, locals) {\n return $parse(expr)(this, locals);\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$evalAsync\n * @kind function\n *\n * @description\n * Executes the expression on the current scope at a later point in time.\n *\n * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n * that:\n *\n * - it will execute after the function that scheduled the evaluation (preferably before DOM\n * rendering).\n * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n * `expression` execution.\n *\n * Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n * will be scheduled. However, it is encouraged to always call code that changes the model\n * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n *\n * @param {(string|function())=} expression An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n */\n $evalAsync: function (expr, locals) {\n // if we are outside of an $digest loop and this is the first time we are scheduling async\n // task also schedule async auto-flush\n if (!$rootScope.$$phase && !asyncQueue.length) {\n $browser.defer(function () {\n if (asyncQueue.length) {\n $rootScope.$digest();\n }\n }, null, '$evalAsync');\n }\n asyncQueue.push({\n scope: this,\n fn: $parse(expr),\n locals: locals\n });\n },\n $$postDigest: function (fn) {\n postDigestQueue.push(fn);\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$apply\n * @kind function\n *\n * @description\n * `$apply()` is used to execute an expression in AngularJS from outside of the AngularJS\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the AngularJS framework we need to perform proper scope life\n * cycle of {@link ng.$exceptionHandler exception handling},\n * {@link ng.$rootScope.Scope#$digest executing watches}.\n *\n * **Life cycle: Pseudo-Code of `$apply()`**\n *\n * ```js\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * ```\n *\n *\n * Scope's `$apply()` method transitions through the following stages:\n *\n * 1. The {@link guide/expression expression} is executed using the\n * {@link ng.$rootScope.Scope#$eval $eval()} method.\n * 2. Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n *\n *\n * @param {(string|function())=} exp An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n *\n * @returns {*} The result of evaluating the expression.\n */\n $apply: function (expr) {\n try {\n beginPhase('$apply');\n try {\n return this.$eval(expr);\n } finally {\n clearPhase();\n }\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n try {\n $rootScope.$digest();\n } catch (e) {\n $exceptionHandler(e);\n // eslint-disable-next-line no-unsafe-finally\n throw e;\n }\n }\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$applyAsync\n * @kind function\n *\n * @description\n * Schedule the invocation of $apply to occur at a later time. The actual time difference\n * varies across browsers, but is typically around ~10 milliseconds.\n *\n * This can be used to queue up multiple expressions which need to be evaluated in the same\n * digest.\n *\n * @param {(string|function())=} exp An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n */\n $applyAsync: function (expr) {\n var scope = this;\n if (expr) {\n applyAsyncQueue.push($applyAsyncExpression);\n }\n expr = $parse(expr);\n scheduleApplyAsync();\n function $applyAsyncExpression() {\n scope.$eval(expr);\n }\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$on\n * @kind function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n * discussion of event life cycle.\n *\n * The event listener function format is: `function(event, args...)`. The `event` object\n * passed into the listener has the following attributes:\n *\n * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n * `$broadcast`-ed.\n * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n * event propagates through the scope hierarchy, this property is set to null.\n * - `name` - `{string}`: name of the event.\n * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n * further event propagation (available only for events that were `$emit`-ed).\n * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n * to true.\n * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n *\n * @param {string} name Event name to listen on.\n * @param {function(event, ...args)} listener Function to call when the event is emitted.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $on: function (name, listener) {\n var namedListeners = this.$$listeners[name];\n if (!namedListeners) {\n this.$$listeners[name] = namedListeners = [];\n }\n namedListeners.push(listener);\n var current = this;\n do {\n if (!current.$$listenerCount[name]) {\n current.$$listenerCount[name] = 0;\n }\n current.$$listenerCount[name]++;\n } while (current = current.$parent);\n var self = this;\n return function () {\n var indexOfListener = namedListeners.indexOf(listener);\n if (indexOfListener !== -1) {\n // Use delete in the hope of the browser deallocating the memory for the array entry,\n // while not shifting the array indexes of other listeners.\n // See issue https://github.com/angular/angular.js/issues/16135\n delete namedListeners[indexOfListener];\n decrementListenerCount(self, 1, name);\n }\n };\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$emit\n * @kind function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n * registered listeners along the way. The event will stop propagating if one of the listeners\n * cancels it.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to emit.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n */\n $emit: function (name, args) {\n var empty = [],\n namedListeners,\n scope = this,\n stopPropagation = false,\n event = {\n name: name,\n targetScope: scope,\n stopPropagation: function () {\n stopPropagation = true;\n },\n preventDefault: function () {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n },\n listenerArgs = concat([event], arguments, 1),\n i,\n length;\n do {\n namedListeners = scope.$$listeners[name] || empty;\n event.currentScope = scope;\n for (i = 0, length = namedListeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!namedListeners[i]) {\n namedListeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n //allow all listeners attached to the current scope to run\n namedListeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n //if any listener on the current scope stops propagation, prevent bubbling\n if (stopPropagation) {\n break;\n }\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n event.currentScope = null;\n return event;\n },\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$broadcast\n * @kind function\n *\n * @description\n * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n * scope and calls all registered listeners along the way. The event cannot be canceled.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to broadcast.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n */\n $broadcast: function (name, args) {\n var target = this,\n current = target,\n next = target,\n event = {\n name: name,\n targetScope: target,\n preventDefault: function () {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n };\n if (!target.$$listenerCount[name]) return event;\n var listenerArgs = concat([event], arguments, 1),\n listeners,\n i,\n length;\n\n //down while you can, then up and next sibling or up and next sibling until back at root\n while (current = next) {\n event.currentScope = current;\n listeners = current.$$listeners[name] || [];\n for (i = 0, length = listeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!listeners[i]) {\n listeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n listeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $digest\n // (though it differs due to having the extra check for $$listenerCount and\n // does not check $$suspended)\n if (!(next = current.$$listenerCount[name] && current.$$childHead || current !== target && current.$$nextSibling)) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n }\n event.currentScope = null;\n return event;\n }\n };\n var $rootScope = new Scope();\n\n //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n var asyncQueue = $rootScope.$$asyncQueue = [];\n var postDigestQueue = $rootScope.$$postDigestQueue = [];\n var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n var postDigestQueuePosition = 0;\n return $rootScope;\n function beginPhase(phase) {\n if ($rootScope.$$phase) {\n throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n }\n $rootScope.$$phase = phase;\n }\n function clearPhase() {\n $rootScope.$$phase = null;\n }\n function incrementWatchersCount(current, count) {\n do {\n current.$$watchersCount += count;\n } while (current = current.$parent);\n }\n function decrementListenerCount(current, count, name) {\n do {\n current.$$listenerCount[name] -= count;\n if (current.$$listenerCount[name] === 0) {\n delete current.$$listenerCount[name];\n }\n } while (current = current.$parent);\n }\n\n /**\n * function used as an initial value for watchers.\n * because it's unique we can easily tell it apart from other values\n */\n function initWatchVal() {}\n function flushApplyAsync() {\n while (applyAsyncQueue.length) {\n try {\n applyAsyncQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n applyAsyncId = null;\n }\n function scheduleApplyAsync() {\n if (applyAsyncId === null) {\n applyAsyncId = $browser.defer(function () {\n $rootScope.$apply(flushApplyAsync);\n }, null, '$applyAsync');\n }\n }\n }];\n }\n\n /**\n * @ngdoc service\n * @name $rootElement\n *\n * @description\n * The root element of AngularJS application. This is either the element where {@link\n * ng.directive:ngApp ngApp} was declared or the element passed into\n * {@link angular.bootstrap}. The element represents the root element of application. It is also the\n * location where the application's {@link auto.$injector $injector} service gets\n * published, and can be retrieved using `$rootElement.injector()`.\n */\n\n // the implementation is in angular.bootstrap\n\n /**\n * @this\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\n function $$SanitizeUriProvider() {\n var aHrefSanitizationTrustedUrlList = /^\\s*(https?|s?ftp|mailto|tel|file):/,\n imgSrcSanitizationTrustedUrlList = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links.\n *\n * Any url due to be assigned to an `a[href]` attribute via interpolation is marked as requiring\n * the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)`\n * which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL.\n *\n * If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged.\n *\n * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written\n * to the DOM it is inactive and potentially malicious code will not be executed.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationTrustedUrlList = function (regexp) {\n if (isDefined(regexp)) {\n aHrefSanitizationTrustedUrlList = regexp;\n return this;\n }\n return aHrefSanitizationTrustedUrlList;\n };\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links.\n *\n * Any URL due to be assigned to an `img[src]` attribute via interpolation is marked as requiring\n * the $sce.MEDIA_URL security context. When interpolation occurs a call is made to\n * `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize\n * the potentially malicious URL.\n *\n * If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned\n * unchanged.\n *\n * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written\n * to the DOM it is inactive and potentially malicious code will not be executed.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationTrustedUrlList = function (regexp) {\n if (isDefined(regexp)) {\n imgSrcSanitizationTrustedUrlList = regexp;\n return this;\n }\n return imgSrcSanitizationTrustedUrlList;\n };\n this.$get = function () {\n return function sanitizeUri(uri, isMediaUrl) {\n // if (!uri) return uri;\n var regex = isMediaUrl ? imgSrcSanitizationTrustedUrlList : aHrefSanitizationTrustedUrlList;\n var normalizedVal = urlResolve(uri && uri.trim()).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:' + normalizedVal;\n }\n return uri;\n };\n };\n }\n\n /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n /* exported $SceProvider, $SceDelegateProvider */\n\n var $sceMinErr = minErr('$sce');\n var SCE_CONTEXTS = {\n // HTML is used when there's HTML rendered (e.g. ng-bind-html, iframe srcdoc binding).\n HTML: 'html',\n // Style statements or stylesheets. Currently unused in AngularJS.\n CSS: 'css',\n // An URL used in a context where it refers to the source of media, which are not expected to be run\n // as scripts, such as an image, audio, video, etc.\n MEDIA_URL: 'mediaUrl',\n // An URL used in a context where it does not refer to a resource that loads code.\n // A value that can be trusted as a URL can also trusted as a MEDIA_URL.\n URL: 'url',\n // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as\n // code. (e.g. ng-include, script src binding, templateUrl)\n // A value that can be trusted as a RESOURCE_URL, can also trusted as a URL and a MEDIA_URL.\n RESOURCE_URL: 'resourceUrl',\n // Script. Currently unused in AngularJS.\n JS: 'js'\n };\n\n // Helper functions follow.\n\n var UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g;\n function snakeToCamel(name) {\n return name.replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace);\n }\n function adjustMatcher(matcher) {\n if (matcher === 'self') {\n return matcher;\n } else if (isString(matcher)) {\n // Strings match exactly except for 2 wildcards - '*' and '**'.\n // '*' matches any character except those from the set ':/.?&'.\n // '**' matches any character (like .* in a RegExp).\n // More than 2 *'s raises an error as it's ill defined.\n if (matcher.indexOf('***') > -1) {\n throw $sceMinErr('iwcard', 'Illegal sequence *** in string matcher. String: {0}', matcher);\n }\n matcher = escapeForRegexp(matcher).replace(/\\\\\\*\\\\\\*/g, '.*').replace(/\\\\\\*/g, '[^:/.?&;]*');\n return new RegExp('^' + matcher + '$');\n } else if (isRegExp(matcher)) {\n // The only other type of matcher allowed is a Regexp.\n // Match entire URL / disallow partial matches.\n // Flags are reset (i.e. no global, ignoreCase or multiline)\n return new RegExp('^' + matcher.source + '$');\n } else {\n throw $sceMinErr('imatcher', 'Matchers may only be \"self\", string patterns or RegExp objects');\n }\n }\n function adjustMatchers(matchers) {\n var adjustedMatchers = [];\n if (isDefined(matchers)) {\n forEach(matchers, function (matcher) {\n adjustedMatchers.push(adjustMatcher(matcher));\n });\n }\n return adjustedMatchers;\n }\n\n /**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * For an overview of this service and the functionnality it provides in AngularJS, see the main\n * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how\n * SCE works in their application, which shouldn't be needed in most cases.\n *\n *
\n * AngularJS strongly relies on contextual escaping for the security of bindings: disabling or\n * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,\n * changes to this service will also influence users, so be extra careful and document your changes.\n *
\n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain. While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own trusted and banned resource lists for trusting URLs used for loading AngularJS resources\n * such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * $sceDelegateProvider.trustedResourceUrlList} and {@link\n * ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}\n */\n\n /**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @this\n *\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.\n *\n * The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and\n * `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularJS templates and\n * other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See\n * {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * $sceDelegateProvider.trustedResourceUrlList} and\n * {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},\n *\n * For the general details about this service in AngularJS, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case.
\n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n * angular.module('myApp', []).config(function($sceDelegateProvider) {\n * $sceDelegateProvider.trustedResourceUrlList([\n * // Allow same origin resource loads.\n * 'self',\n * // Allow loading from our assets domain. Notice the difference between * and **.\n * 'http://srv*.assets.example.com/**'\n * ]);\n *\n * // The banned resource URL list overrides the trusted resource URL list so the open redirect\n * // here is blocked.\n * $sceDelegateProvider.bannedResourceUrlList([\n * 'http://myapp.example.com/clickThru**'\n * ]);\n * });\n * ```\n * Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require\n * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates\n * requested by {@link ng.$templateRequest $templateRequest} that are present in\n * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism\n * to populate your templates in that cache at config time, then it is a good idea to remove 'self'\n * from the trusted resource URL lsit. This helps to mitigate the security impact of certain types\n * of issues, like for instance attacker-controlled `ng-includes`.\n */\n\n function $SceDelegateProvider() {\n this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n // Resource URLs can also be trusted by policy.\n var trustedResourceUrlList = ['self'],\n bannedResourceUrlList = [];\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#trustedResourceUrlList\n * @kind function\n *\n * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with\n * the value provided. This must be an array or null. A snapshot of this array is used so\n * further changes to the array are ignored.\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * @return {Array} The currently set trusted resource URL array.\n *\n * @description\n * Sets/Gets the list trusted of resource URLs.\n *\n * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`\n * allowing only same origin resource requests.\n *\n *
\n * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares\n * its origin with other apps! It is a good idea to limit it to only your application's directory.\n *
\n */\n this.trustedResourceUrlList = function (value) {\n if (arguments.length) {\n trustedResourceUrlList = adjustMatchers(value);\n }\n return trustedResourceUrlList;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $sceDelegateProvider#trustedResourceUrlList\n * trustedResourceUrlList} instead.\n */\n Object.defineProperty(this, 'resourceUrlWhitelist', {\n get: function () {\n return this.trustedResourceUrlList;\n },\n set: function (value) {\n this.trustedResourceUrlList = value;\n }\n });\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#bannedResourceUrlList\n * @kind function\n *\n * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with\n * the value provided. This must be an array or null. A snapshot of this array is used so\n * further changes to the array are ignored.

\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.

\n * The typical usage for the `bannedResourceUrlList` is to **block\n * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n * these would otherwise be trusted but actually return content from the redirected domain.\n *

\n * Finally, **the banned resource URL list overrides the trusted resource URL list** and has\n * the final say.\n *\n * @return {Array} The currently set `bannedResourceUrlList` array.\n *\n * @description\n * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.\n *\n * The **default value** when no trusted resource URL list has been explicitly set is the empty\n * array (i.e. there is no `bannedResourceUrlList`.)\n */\n this.bannedResourceUrlList = function (value) {\n if (arguments.length) {\n bannedResourceUrlList = adjustMatchers(value);\n }\n return bannedResourceUrlList;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlBlacklist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList\n * bannedResourceUrlList} instead.\n */\n Object.defineProperty(this, 'resourceUrlBlacklist', {\n get: function () {\n return this.bannedResourceUrlList;\n },\n set: function (value) {\n this.bannedResourceUrlList = value;\n }\n });\n this.$get = ['$injector', '$$sanitizeUri', function ($injector, $$sanitizeUri) {\n var htmlSanitizer = function htmlSanitizer(html) {\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n };\n if ($injector.has('$sanitize')) {\n htmlSanitizer = $injector.get('$sanitize');\n }\n function matchUrl(matcher, parsedUrl) {\n if (matcher === 'self') {\n return urlIsSameOrigin(parsedUrl) || urlIsSameOriginAsBaseUrl(parsedUrl);\n } else {\n // definitely a regex. See adjustMatchers()\n return !!matcher.exec(parsedUrl.href);\n }\n }\n function isResourceUrlAllowedByPolicy(url) {\n var parsedUrl = urlResolve(url.toString());\n var i,\n n,\n allowed = false;\n // Ensure that at least one item from the trusted resource URL list allows this url.\n for (i = 0, n = trustedResourceUrlList.length; i < n; i++) {\n if (matchUrl(trustedResourceUrlList[i], parsedUrl)) {\n allowed = true;\n break;\n }\n }\n if (allowed) {\n // Ensure that no item from the banned resource URL list has blocked this url.\n for (i = 0, n = bannedResourceUrlList.length; i < n; i++) {\n if (matchUrl(bannedResourceUrlList[i], parsedUrl)) {\n allowed = false;\n break;\n }\n }\n }\n return allowed;\n }\n function generateHolderType(Base) {\n var holderType = function TrustedValueHolderType(trustedValue) {\n this.$$unwrapTrustedValue = function () {\n return trustedValue;\n };\n };\n if (Base) {\n holderType.prototype = new Base();\n }\n holderType.prototype.valueOf = function sceValueOf() {\n return this.$$unwrapTrustedValue();\n };\n holderType.prototype.toString = function sceToString() {\n return this.$$unwrapTrustedValue().toString();\n };\n return holderType;\n }\n var trustedValueHolderBase = generateHolderType(),\n byType = {};\n byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.MEDIA_URL] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.URL] = generateHolderType(byType[SCE_CONTEXTS.MEDIA_URL]);\n byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n /**\n * @ngdoc method\n * @name $sceDelegate#trustAs\n *\n * @description\n * Returns a trusted representation of the parameter for the specified context. This trusted\n * object will later on be used as-is, without any security check, by bindings or directives\n * that require this security context.\n * For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass\n * the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as\n * `ng-bind-html`. Note that in most cases you won't need to call this function: if you have the\n * sanitizer loaded, passing the value itself will render all the HTML that does not pose a\n * security risk.\n *\n * See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those\n * trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual\n * escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that should be considered trusted.\n * @return {*} A trusted representation of value, that can be used in the given context.\n */\n function trustAs(type, trustedValue) {\n var Constructor = byType.hasOwnProperty(type) ? byType[type] : null;\n if (!Constructor) {\n throw $sceMinErr('icontext', 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}', type, trustedValue);\n }\n if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {\n return trustedValue;\n }\n // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting\n // mutable objects, we ensure here that the value passed in is actually a string.\n if (typeof trustedValue !== 'string') {\n throw $sceMinErr('itype', 'Attempted to trust a non-string value in a content requiring a string: Context: {0}', type);\n }\n return new Constructor(trustedValue);\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#valueOf\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, it must be returned as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @return {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns\n * `value` unchanged.\n */\n function valueOf(maybeTrusted) {\n if (maybeTrusted instanceof trustedValueHolderBase) {\n return maybeTrusted.$$unwrapTrustedValue();\n } else {\n return maybeTrusted;\n }\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#getTrusted\n *\n * @description\n * Given an object and a security context in which to assign it, returns a value that's safe to\n * use in this context, which was represented by the parameter. To do so, this function either\n * unwraps the safe type it has been given (for instance, a {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} result), or it might try to sanitize the value given, depending on\n * the context and sanitizer availablility.\n *\n * The contexts that can be sanitized are $sce.MEDIA_URL, $sce.URL and $sce.HTML. The first two are available\n * by default, and the third one relies on the `$sanitize` service (which may be loaded through\n * the `ngSanitize` module). Furthermore, for $sce.RESOURCE_URL context, a plain string may be\n * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * `$sceDelegateProvider.trustedResourceUrlList`} and {@link ng.$sceDelegateProvider#bannedResourceUrlList\n * `$sceDelegateProvider.bannedResourceUrlList`} accepts that resource.\n *\n * This function will throw if the safe type isn't appropriate for this context, or if the\n * value given cannot be accepted in the context (which might be caused by sanitization not\n * being available, or the value not being recognized as safe).\n *\n *

\n * Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting\n * (XSS) vulnerability in your application.\n *
\n *\n * @param {string} type The context in which this value is to be used (such as `$sce.HTML`).\n * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n function getTrusted(type, maybeTrusted) {\n if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {\n return maybeTrusted;\n }\n var constructor = byType.hasOwnProperty(type) ? byType[type] : null;\n // If maybeTrusted is a trusted class instance or subclass instance, then unwrap and return\n // as-is.\n if (constructor && maybeTrusted instanceof constructor) {\n return maybeTrusted.$$unwrapTrustedValue();\n }\n\n // If maybeTrusted is a trusted class instance but not of the correct trusted type\n // then unwrap it and allow it to pass through to the rest of the checks\n if (isFunction(maybeTrusted.$$unwrapTrustedValue)) {\n maybeTrusted = maybeTrusted.$$unwrapTrustedValue();\n }\n\n // If we get here, then we will either sanitize the value or throw an exception.\n if (type === SCE_CONTEXTS.MEDIA_URL || type === SCE_CONTEXTS.URL) {\n // we attempt to sanitize non-resource URLs\n return $$sanitizeUri(maybeTrusted.toString(), type === SCE_CONTEXTS.MEDIA_URL);\n } else if (type === SCE_CONTEXTS.RESOURCE_URL) {\n if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n return maybeTrusted;\n } else {\n throw $sceMinErr('insecurl', 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}', maybeTrusted.toString());\n }\n } else if (type === SCE_CONTEXTS.HTML) {\n // htmlSanitizer throws its own error when no sanitizer is available.\n return htmlSanitizer(maybeTrusted);\n }\n // Default error when the $sce service has no way to make the input safe.\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n }\n return {\n trustAs: trustAs,\n getTrusted: getTrusted,\n valueOf: valueOf\n };\n }];\n }\n\n /**\n * @ngdoc provider\n * @name $sceProvider\n * @this\n *\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * - enable/disable Strict Contextual Escaping (SCE) in a module\n * - override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n /**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * ## Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render\n * trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and\n * (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * ### Overview\n *\n * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in\n * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically\n * run security checks on them (sanitizations, trusted URL resource, depending on context), or throw\n * when it cannot guarantee the security of the result. That behavior depends strongly on contexts:\n * HTML can be sanitized, but template URLs cannot, for instance.\n *\n * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML:\n * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it\n * before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and\n * render the input as-is, you will need to mark it as trusted for that context before attempting\n * to bind it.\n *\n * As of version 1.2, AngularJS ships with SCE enabled by default.\n *\n * ### In practice\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * \n *
\n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV, which would\n * be an XSS security bug. In a more realistic example, one may be rendering user comments, blog\n * articles, etc. via bindings. (HTML is just one example of a context where rendering user\n * controlled input creates security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?) How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, AngularJS makes sure bindings go through that sanitization, or\n * any similar validation process, unless there's a good reason to trust the given value in this\n * context. That trust is formalized with a function call. This means that as a developer, you\n * can assume all untrusted bindings are safe. Then, to audit your code for binding security issues,\n * you just need to ensure the values you mark as trusted indeed are safe - because they were\n * received from your server, sanitized by your library, etc. You can organize your codebase to\n * help with this - perhaps allowing only the files in a specific directory to do this.\n * Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then\n * becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * build the trusted versions of your values.\n *\n * ### How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as\n * a way to enforce the required security context in your data sink. Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs\n * the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also,\n * when binding without directives, AngularJS will understand the context of your bindings\n * automatically.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n * return function(scope, element, attr) {\n * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n * element.html(value || '');\n * });\n * };\n * }];\n * ```\n *\n * ### Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, AngularJS only loads templates from the same domain and protocol as the application\n * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or\n * protocols, you may either add them to the {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * trustedResourceUrlList} or {@link ng.$sce#trustAsResourceUrl wrap them} into trusted values.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded. This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers. Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ### This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (e.g.\n * `
implicitly trusted'\">
`) just works (remember to include the\n * `ngSanitize` module). The `$sceDelegate` will also use the `$sanitize` service if it is available\n * when binding untrusted values to `$sce.HTML` context.\n * AngularJS provides an implementation in `angular-sanitize.js`, and if you\n * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in\n * your application.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document. You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#trustedResourceUrlList trusted resource URL list} and {@link\n * ng.$sceDelegateProvider#bannedResourceUrlList banned resource URL list} for matching such URLs.\n *\n * This significantly reduces the overhead. It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * \n * ### What trusted context types are supported?\n *\n * | Context | Notes |\n * |---------------------|----------------|\n * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |\n * | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. |\n * | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.|\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)

Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required.

The {@link $sceDelegateProvider#trustedResourceUrlList $sceDelegateProvider#trustedResourceUrlList()} and {@link $sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider#bannedResourceUrlList()} can be used to restrict trusted origins for `RESOURCE_URL` |\n * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |\n *\n *\n *
\n * Be aware that, before AngularJS 1.7.0, `a[href]` and `img[src]` used to sanitize their\n * interpolated values directly rather than rely upon {@link ng.$sce#getTrusted `$sce.getTrusted`}.\n *\n * **As of 1.7.0, this is no longer the case.**\n *\n * Now such interpolations are marked as requiring `$sce.URL` (for `a[href]`) or `$sce.MEDIA_URL`\n * (for `img[src]`), so that the sanitization happens (via `$sce.getTrusted...`) when the `$interpolate`\n * service evaluates the expressions.\n *
\n *\n * There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs`\n * functions aren't useful yet. This might evolve.\n *\n * ### Format of items in {@link ng.$sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList}/{@link ng.$sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList} \n *\n * Each element in these arrays must be one of the following:\n *\n * - **'self'**\n * - The special **string**, `'self'`, can be used to match against all URLs of the **same\n * domain** as the application document using the **same protocol**.\n * - **String** (except the special value `'self'`)\n * - The string is matched against the full *normalized / absolute URL* of the resource\n * being tested (substring matches are not good enough.)\n * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters\n * match themselves.\n * - `*`: matches zero or more occurrences of any character other than one of the following 6\n * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use\n * for matching resource URL lists.\n * - `**`: matches zero or more occurrences of *any* character. As such, it's not\n * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.\n * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n * not have been the intention.) Its usage at the very end of the path is ok. (e.g.\n * http://foo.example.com/templates/**).\n * - **RegExp** (*see caveat below*)\n * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax\n * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to\n * accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n * have good test coverage). For instance, the use of `.` in the regex is correct only in a\n * small number of cases. A `.` character in the regex used when matching the scheme or a\n * subdomain could be matched against a `:` or literal `.` that was likely not intended. It\n * is highly recommended to use the string patterns and only fall back to regular expressions\n * as a last resort.\n * - The regular expression must be an instance of RegExp (i.e. not a string.) It is\n * matched against the **entire** *normalized / absolute URL* of the resource being tested\n * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags\n * present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n * - If you are generating your JavaScript from some other templating engine (not\n * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n * remember to escape your regular expression (and be aware that you might need more than\n * one level of escaping depending on your templating engine and the way you interpolated\n * the value.) Do make use of your platform's escaping mechanism as it might be good\n * enough before coding your own. E.g. Ruby has\n * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n * Javascript lacks a similar built in function for escaping. Take a look at Google\n * Closure library's [goog.string.regExpEscape(s)](\n * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ### Show me an example using SCE.\n *\n * \n * \n *
\n *

\n * User comments
\n * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n * $sanitize is available. If $sanitize isn't available, this results in an error instead of an\n * exploit.\n *
\n *
\n * {{userComment.name}}:\n * \n *
\n *
\n *
\n *
\n *
\n *\n * \n * angular.module('mySceApp', ['ngSanitize'])\n * .controller('AppController', ['$http', '$templateCache', '$sce',\n * function AppController($http, $templateCache, $sce) {\n * var self = this;\n * $http.get('test_data.json', {cache: $templateCache}).then(function(response) {\n * self.userComments = response.data;\n * });\n * self.explicitlyTrustedHtml = $sce.trustAsHtml(\n * 'Hover over this text.');\n * }]);\n * \n *\n * \n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"Is anyone reading this?\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"Yes! Am I the only other one?\"\n * }\n * ]\n * \n *\n * \n * describe('SCE doc demo', function() {\n * it('should sanitize untrusted values', function() {\n * expect(element.all(by.css('.htmlComment')).first().getAttribute('innerHTML'))\n * .toBe('Is anyone reading this?');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe(\n * 'Hover over this text.');\n * });\n * });\n * \n *
\n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits\n * for little coding overhead. It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time. Also do note that this is an app-wide setting, so if\n * you are writing a library, you will cause security bugs applications using it.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n * // Completely disable SCE. For demonstration purposes only!\n * // Do not use in new projects or libraries.\n * $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n\n function $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc method\n * @name $sceProvider#enabled\n * @kind function\n *\n * @param {boolean=} value If provided, then enables/disables SCE application-wide.\n * @return {boolean} True if SCE is enabled, false otherwise.\n *\n * @description\n * Enables/disables SCE and returns the current value.\n */\n this.enabled = function (value) {\n if (arguments.length) {\n enabled = !!value;\n }\n return enabled;\n };\n\n /* Design notes on the default implementation for SCE.\n *\n * The API contract for the SCE delegate\n * -------------------------------------\n * The SCE delegate object must provide the following 3 methods:\n *\n * - trustAs(contextEnum, value)\n * This method is used to tell the SCE service that the provided value is OK to use in the\n * contexts specified by contextEnum. It must return an object that will be accepted by\n * getTrusted() for a compatible contextEnum and return this value.\n *\n * - valueOf(value)\n * For values that were not produced by trustAs(), return them as is. For values that were\n * produced by trustAs(), return the corresponding input value to trustAs. Basically, if\n * trustAs is wrapping the given values into some type, this operation unwraps it when given\n * such a value.\n *\n * - getTrusted(contextEnum, value)\n * This function should return the value that is safe to use in the context specified by\n * contextEnum or throw and exception otherwise.\n *\n * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n * opaque or wrapped in some holder object. That happens to be an implementation detail. For\n * instance, an implementation could maintain a registry of all trusted objects by context. In\n * such a case, trustAs() would return the same object that was passed in. getTrusted() would\n * return the same object passed in if it was found in the registry under a compatible context or\n * throw an exception otherwise. An implementation might only wrap values some of the time based\n * on some criteria. getTrusted() might return a value and not throw an exception for special\n * constants or objects even if not wrapped. All such implementations fulfill this contract.\n *\n *\n * A note on the inheritance model for SCE contexts\n * ------------------------------------------------\n * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This\n * is purely an implementation details.\n *\n * The contract is simply this:\n *\n * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n * will also succeed.\n *\n * Inheritance happens to capture this in a natural way. In some future, we may not use\n * inheritance anymore. That is OK because no code outside of sce.js and sceSpecs.js would need to\n * be aware of this detail.\n */\n\n this.$get = ['$parse', '$sceDelegate', function ($parse, $sceDelegate) {\n // Support: IE 9-11 only\n // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && msie < 8) {\n throw $sceMinErr('iequirks', 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' + 'mode. You can fix this by adding the text to the top of your HTML ' + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');\n }\n var sce = shallowCopy(SCE_CONTEXTS);\n\n /**\n * @ngdoc method\n * @name $sce#isEnabled\n * @kind function\n *\n * @return {Boolean} True if SCE is enabled, false otherwise. If you want to set the value, you\n * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n *\n * @description\n * Returns a boolean indicating if SCE is enabled.\n */\n sce.isEnabled = function () {\n return enabled;\n };\n sce.trustAs = $sceDelegate.trustAs;\n sce.getTrusted = $sceDelegate.getTrusted;\n sce.valueOf = $sceDelegate.valueOf;\n if (!enabled) {\n sce.trustAs = sce.getTrusted = function (type, value) {\n return value;\n };\n sce.valueOf = identity;\n }\n\n /**\n * @ngdoc method\n * @name $sce#parseAs\n *\n * @description\n * Converts AngularJS {@link guide/expression expression} into a function. This is like {@link\n * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it\n * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n * *result*)}\n *\n * @param {string} type The SCE context in which this result will be used.\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n sce.parseAs = function sceParseAs(type, expr) {\n var parsed = $parse(expr);\n if (parsed.literal && parsed.constant) {\n return parsed;\n } else {\n return $parse(expr, function (value) {\n return sce.getTrusted(type, value);\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name $sce#trustAs\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, returns a\n * wrapped object that represents your value, and the trust you have in its safety for the given\n * context. AngularJS can then use that value as-is in bindings of the specified secure context.\n * This is used in bindings for `ng-bind-html`, `ng-include`, and most `src` attribute\n * interpolations. See {@link ng.$sce $sce} for strict contextual escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that that should be considered trusted.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in the context you specified.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsHtml\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.HTML` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.HTML` context (like `ng-bind-html`).\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsCss\n *\n * @description\n * Shorthand method. `$sce.trustAsCss(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.CSS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.CSS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant\n * of your `value` in `$sce.CSS` context. This context is currently unused, so there are\n * almost no reasons to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.URL` context. That context is currently unused, so there are almost no reasons\n * to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.RESOURCE_URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.RESOURCE_URL` context (template URLs in `ng-include`, most `src` attribute\n * bindings, ...)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsJs\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.JS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.JS` context. That context is currently unused, so there are almost no reasons to\n * use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrusted\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes any input, and either returns a value that's safe to use in the specified context,\n * or throws an exception. This function is aware of trusted values created by the `trustAs`\n * function and its shorthands, and when contexts are appropriate, returns the unwrapped value\n * as-is. Finally, this function can also throw when there is no way to turn `maybeTrusted` in a\n * safe value (e.g., no sanitization is available or possible.)\n *\n * @param {string} type The context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs\n * `$sce.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedHtml\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedCss\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedResourceUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedJs\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.JS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsHtml\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsCss\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsJs\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n // Shorthand delegations.\n var parse = sce.parseAs,\n getTrusted = sce.getTrusted,\n trustAs = sce.trustAs;\n forEach(SCE_CONTEXTS, function (enumValue, name) {\n var lName = lowercase(name);\n sce[snakeToCamel('parse_as_' + lName)] = function (expr) {\n return parse(enumValue, expr);\n };\n sce[snakeToCamel('get_trusted_' + lName)] = function (value) {\n return getTrusted(enumValue, value);\n };\n sce[snakeToCamel('trust_as_' + lName)] = function (value) {\n return trustAs(enumValue, value);\n };\n });\n return sce;\n }];\n }\n\n /* exported $SnifferProvider */\n\n /**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n * @this\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\n function $SnifferProvider() {\n this.$get = ['$window', '$document', function ($window, $document) {\n var eventSupport = {},\n // Chrome Packaged Apps are not allowed to access `history.pushState`.\n // If not sandboxed, they can be detected by the presence of `chrome.app.runtime`\n // (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by\n // the presence of an extension runtime ID and the absence of other Chrome runtime APIs\n // (see https://developer.chrome.com/apps/manifest/sandbox).\n // (NW.js apps have access to Chrome APIs, but do support `history`.)\n isNw = $window.nw && $window.nw.process,\n isChromePackagedApp = !isNw && $window.chrome && ($window.chrome.app && $window.chrome.app.runtime || !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id),\n hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState,\n android = toInt((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n document = $document[0] || {},\n bodyStyle = document.body && document.body.style,\n transitions = false,\n animations = false;\n if (bodyStyle) {\n // Support: Android <5, Blackberry Browser 10, default Chrome in Android 4.4.x\n // Mentioned browsers need a -webkit- prefix for transitions & animations.\n transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle);\n animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle);\n }\n return {\n // Android has history.pushState, but it does not update location correctly\n // so let's not use the history API at all.\n // http://code.google.com/p/android/issues/detail?id=17471\n // https://github.com/angular/angular.js/issues/904\n\n // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n // so let's not use the history API also\n // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n history: !!(hasHistoryPushState && !(android < 4) && !boxee),\n hasEvent: function (event) {\n // Support: IE 9-11 only\n // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n // it. In particular the event is not fired when backspace or delete key are pressed or\n // when cut operation is performed.\n // IE10+ implements 'input' event but it erroneously fires under various situations,\n // e.g. when placeholder changes, or a form is focused.\n if (event === 'input' && msie) return false;\n if (isUndefined(eventSupport[event])) {\n var divElm = document.createElement('div');\n eventSupport[event] = 'on' + event in divElm;\n }\n return eventSupport[event];\n },\n csp: csp(),\n transitions: transitions,\n animations: animations,\n android: android\n };\n }];\n }\n\n /**\n * ! This is a private undocumented service !\n *\n * @name $$taskTrackerFactory\n * @description\n * A function to create `TaskTracker` instances.\n *\n * A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested\n * parties when all pending tasks (or tasks of a specific type) have been completed.\n *\n * @param {$log} log - A logger instance (such as `$log`). Used to log error during callback\n * execution.\n *\n * @this\n */\n function $$TaskTrackerFactoryProvider() {\n this.$get = valueFn(function (log) {\n return new TaskTracker(log);\n });\n }\n function TaskTracker(log) {\n var self = this;\n var taskCounts = {};\n var taskCallbacks = [];\n var ALL_TASKS_TYPE = self.ALL_TASKS_TYPE = '$$all$$';\n var DEFAULT_TASK_TYPE = self.DEFAULT_TASK_TYPE = '$$default$$';\n\n /**\n * Execute the specified function and decrement the appropriate `taskCounts` counter.\n * If the counter reaches 0, all corresponding `taskCallbacks` are executed.\n *\n * @param {Function} fn - The function to execute.\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task that is being completed.\n */\n self.completeTask = completeTask;\n\n /**\n * Increase the task count for the specified task type (or the default task type if non is\n * specified).\n *\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task whose count will be increased.\n */\n self.incTaskCount = incTaskCount;\n\n /**\n * Execute the specified callback when all pending tasks have been completed.\n *\n * If there are no pending tasks, the callback is executed immediately. You can optionally limit\n * the tasks that will be waited for to a specific type, by passing a `taskType`.\n *\n * @param {function} callback - The function to call when there are no pending tasks.\n * @param {string=} [taskType=ALL_TASKS_TYPE] - The type of tasks that will be waited for.\n */\n self.notifyWhenNoPendingTasks = notifyWhenNoPendingTasks;\n function completeTask(fn, taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n try {\n fn();\n } finally {\n decTaskCount(taskType);\n var countForType = taskCounts[taskType];\n var countForAll = taskCounts[ALL_TASKS_TYPE];\n\n // If at least one of the queues (`ALL_TASKS_TYPE` or `taskType`) is empty, run callbacks.\n if (!countForAll || !countForType) {\n var getNextCallback = !countForAll ? getLastCallback : getLastCallbackForType;\n var nextCb;\n while (nextCb = getNextCallback(taskType)) {\n try {\n nextCb();\n } catch (e) {\n log.error(e);\n }\n }\n }\n }\n }\n function decTaskCount(taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n if (taskCounts[taskType]) {\n taskCounts[taskType]--;\n taskCounts[ALL_TASKS_TYPE]--;\n }\n }\n function getLastCallback() {\n var cbInfo = taskCallbacks.pop();\n return cbInfo && cbInfo.cb;\n }\n function getLastCallbackForType(taskType) {\n for (var i = taskCallbacks.length - 1; i >= 0; --i) {\n var cbInfo = taskCallbacks[i];\n if (cbInfo.type === taskType) {\n taskCallbacks.splice(i, 1);\n return cbInfo.cb;\n }\n }\n }\n function incTaskCount(taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n taskCounts[taskType] = (taskCounts[taskType] || 0) + 1;\n taskCounts[ALL_TASKS_TYPE] = (taskCounts[ALL_TASKS_TYPE] || 0) + 1;\n }\n function notifyWhenNoPendingTasks(callback, taskType) {\n taskType = taskType || ALL_TASKS_TYPE;\n if (!taskCounts[taskType]) {\n callback();\n } else {\n taskCallbacks.push({\n type: taskType,\n cb: callback\n });\n }\n }\n }\n var $templateRequestMinErr = minErr('$templateRequest');\n\n /**\n * @ngdoc provider\n * @name $templateRequestProvider\n * @this\n *\n * @description\n * Used to configure the options passed to the {@link $http} service when making a template request.\n *\n * For example, it can be used for specifying the \"Accept\" header that is sent to the server, when\n * requesting a template.\n */\n function $TemplateRequestProvider() {\n var httpOptions;\n\n /**\n * @ngdoc method\n * @name $templateRequestProvider#httpOptions\n * @description\n * The options to be passed to the {@link $http} service when making the request.\n * You can use this to override options such as the \"Accept\" header for template requests.\n *\n * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the\n * options if not overridden here.\n *\n * @param {string=} value new value for the {@link $http} options.\n * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.\n */\n this.httpOptions = function (val) {\n if (val) {\n httpOptions = val;\n return this;\n }\n return httpOptions;\n };\n\n /**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service runs security checks then downloads the provided template using\n * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request\n * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the\n * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the\n * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted\n * when `tpl` is of type string and `$templateCache` has the matching entry.\n *\n * If you want to pass custom options to the `$http` service, such as setting the Accept header you\n * can configure this via {@link $templateRequestProvider#httpOptions}.\n *\n * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such\n * as {@link ngInclude} to download and cache templates.\n *\n * 3rd party modules should use `$templateRequest` if their services or directives are loading\n * templates.\n *\n * @param {string|TrustedResourceUrl} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} a promise for the HTTP response data of the given URL.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\n this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce', function ($exceptionHandler, $templateCache, $http, $q, $sce) {\n function handleRequestFn(tpl, ignoreRequestError) {\n handleRequestFn.totalPendingRequests++;\n\n // We consider the template cache holds only trusted templates, so\n // there's no need to go through adding the template again to the trusted\n // resources for keys that already are included in there. This also makes\n // AngularJS accept any script directive, no matter its name. However, we\n // still need to unwrap trusted types.\n if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {\n tpl = $sce.getTrustedResourceUrl(tpl);\n }\n var transformResponse = $http.defaults && $http.defaults.transformResponse;\n if (isArray(transformResponse)) {\n transformResponse = transformResponse.filter(function (transformer) {\n return transformer !== defaultHttpResponseTransform;\n });\n } else if (transformResponse === defaultHttpResponseTransform) {\n transformResponse = null;\n }\n return $http.get(tpl, extend({\n cache: $templateCache,\n transformResponse: transformResponse\n }, httpOptions)).finally(function () {\n handleRequestFn.totalPendingRequests--;\n }).then(function (response) {\n return $templateCache.put(tpl, response.data);\n }, handleError);\n function handleError(resp) {\n if (!ignoreRequestError) {\n resp = $templateRequestMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})', tpl, resp.status, resp.statusText);\n $exceptionHandler(resp);\n }\n return $q.reject(resp);\n }\n }\n handleRequestFn.totalPendingRequests = 0;\n return handleRequestFn;\n }];\n }\n\n /** @this */\n function $$TestabilityProvider() {\n this.$get = ['$rootScope', '$browser', '$location', function ($rootScope, $browser, $location) {\n /**\n * @name $testability\n *\n * @description\n * The private $$testability service provides a collection of methods for use when debugging\n * or by automated test and debugging tools.\n */\n var testability = {};\n\n /**\n * @name $$testability#findBindings\n *\n * @description\n * Returns an array of elements that are bound (via ng-bind or {{}})\n * to expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The binding expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression. Filters and whitespace are ignored.\n */\n testability.findBindings = function (element, expression, opt_exactMatch) {\n var bindings = element.getElementsByClassName('ng-binding');\n var matches = [];\n forEach(bindings, function (binding) {\n var dataBinding = angular.element(binding).data('$binding');\n if (dataBinding) {\n forEach(dataBinding, function (bindingName) {\n if (opt_exactMatch) {\n var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n if (matcher.test(bindingName)) {\n matches.push(binding);\n }\n } else {\n if (bindingName.indexOf(expression) !== -1) {\n matches.push(binding);\n }\n }\n });\n }\n });\n return matches;\n };\n\n /**\n * @name $$testability#findModels\n *\n * @description\n * Returns an array of elements that are two-way found via ng-model to\n * expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The model expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression.\n */\n testability.findModels = function (element, expression, opt_exactMatch) {\n var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n for (var p = 0; p < prefixes.length; ++p) {\n var attributeEquals = opt_exactMatch ? '=' : '*=';\n var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n var elements = element.querySelectorAll(selector);\n if (elements.length) {\n return elements;\n }\n }\n };\n\n /**\n * @name $$testability#getLocation\n *\n * @description\n * Shortcut for getting the location in a browser agnostic way. Returns\n * the path, search, and hash. (e.g. /path?a=b#hash)\n */\n testability.getLocation = function () {\n return $location.url();\n };\n\n /**\n * @name $$testability#setLocation\n *\n * @description\n * Shortcut for navigating to a location without doing a full page reload.\n *\n * @param {string} url The location url (path, search and hash,\n * e.g. /path?a=b#hash) to go to.\n */\n testability.setLocation = function (url) {\n if (url !== $location.url()) {\n $location.url(url);\n $rootScope.$digest();\n }\n };\n\n /**\n * @name $$testability#whenStable\n *\n * @description\n * Calls the callback when all pending tasks are completed.\n *\n * Types of tasks waited for include:\n * - Pending timeouts (via {@link $timeout}).\n * - Pending HTTP requests (via {@link $http}).\n * - In-progress route transitions (via {@link $route}).\n * - Pending tasks scheduled via {@link $rootScope#$applyAsync}.\n * - Pending tasks scheduled via {@link $rootScope#$evalAsync}.\n * These include tasks scheduled via `$evalAsync()` indirectly (such as {@link $q} promises).\n *\n * @param {function} callback\n */\n testability.whenStable = function (callback) {\n $browser.notifyWhenNoOutstandingRequests(callback);\n };\n return testability;\n }];\n }\n var $timeoutMinErr = minErr('$timeout');\n\n /** @this */\n function $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler', function ($rootScope, $browser, $q, $$q, $exceptionHandler) {\n var deferreds = {};\n\n /**\n * @ngdoc service\n * @name $timeout\n *\n * @description\n * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n * block and delegates any exceptions to\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * The return value of calling `$timeout` is a promise, which will be resolved when\n * the delay has passed and the timeout function, if provided, is executed.\n *\n * To cancel a timeout request, call `$timeout.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n * synchronously flush the queue of deferred functions.\n *\n * If you only want a promise that will be resolved after some specified delay\n * then you can call `$timeout` without the `fn` function.\n *\n * @param {function()=} fn A function, whose execution should be delayed.\n * @param {number=} [delay=0] Delay in milliseconds.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise\n * will be resolved with the return value of the `fn` function.\n *\n */\n function timeout(fn, delay, invokeApply) {\n if (!isFunction(fn)) {\n invokeApply = delay;\n delay = fn;\n fn = noop;\n }\n var args = sliceArgs(arguments, 3),\n skipApply = isDefined(invokeApply) && !invokeApply,\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise,\n timeoutId;\n timeoutId = $browser.defer(function () {\n try {\n deferred.resolve(fn.apply(null, args));\n } catch (e) {\n deferred.reject(e);\n $exceptionHandler(e);\n } finally {\n delete deferreds[promise.$$timeoutId];\n }\n if (!skipApply) $rootScope.$apply();\n }, delay, '$timeout');\n promise.$$timeoutId = timeoutId;\n deferreds[timeoutId] = deferred;\n return promise;\n }\n\n /**\n * @ngdoc method\n * @name $timeout#cancel\n *\n * @description\n * Cancels a task associated with the `promise`. As a result of this, the promise will be\n * resolved with a rejection.\n *\n * @param {Promise=} promise Promise returned by the `$timeout` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n timeout.cancel = function (promise) {\n if (!promise) return false;\n if (!promise.hasOwnProperty('$$timeoutId')) {\n throw $timeoutMinErr('badprom', '`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.');\n }\n if (!deferreds.hasOwnProperty(promise.$$timeoutId)) return false;\n var id = promise.$$timeoutId;\n var deferred = deferreds[id];\n\n // Timeout cancels should not report an unhandled promise.\n markQExceptionHandled(deferred.promise);\n deferred.reject('canceled');\n delete deferreds[id];\n return $browser.defer.cancel(id);\n };\n return timeout;\n }];\n }\n\n // NOTE: The usage of window and document instead of $window and $document here is\n // deliberate. This service depends on the specific behavior of anchor nodes created by the\n // browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n // cause us to break tests. In addition, when the browser resolves a URL for XHR, it\n // doesn't know about mocked locations and resolves URLs to the real document - which is\n // exactly the behavior needed here. There is little value is mocking these out for this\n // service.\n var urlParsingNode = window.document.createElement('a');\n var originUrl = urlResolve(window.location.href);\n var baseUrlParsingNode;\n urlParsingNode.href = 'http://[::1]';\n\n // Support: IE 9-11 only, Edge 16-17 only (fixed in 18 Preview)\n // IE/Edge don't wrap IPv6 addresses' hostnames in square brackets\n // when parsed out of an anchor element.\n var ipv6InBrackets = urlParsingNode.hostname === '[::1]';\n\n /**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+ etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string|object} url The URL to be parsed. If `url` is not a string, it will be returned\n * unchanged.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|------------------------------------------------------------------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol without the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol |\n * | hostname | The hostname |\n * | port | The port, without \":\" |\n * | pathname | The pathname, beginning with \"/\" |\n *\n */\n function urlResolve(url) {\n if (!isString(url)) return url;\n var href = url;\n\n // Support: IE 9-11 only\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n urlParsingNode.setAttribute('href', href);\n var hostname = urlParsingNode.hostname;\n if (!ipv6InBrackets && hostname.indexOf(':') > -1) {\n hostname = '[' + hostname + ']';\n }\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: hostname,\n port: urlParsingNode.port,\n pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname\n };\n }\n\n /**\n * Parse a request URL and determine whether this is a same-origin request as the application\n * document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\n function urlIsSameOrigin(requestUrl) {\n return urlsAreSameOrigin(requestUrl, originUrl);\n }\n\n /**\n * Parse a request URL and determine whether it is same-origin as the current document base URL.\n *\n * Note: The base URL is usually the same as the document location (`location.href`) but can\n * be overriden by using the `` tag.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the URL is same-origin as the document base URL.\n */\n function urlIsSameOriginAsBaseUrl(requestUrl) {\n return urlsAreSameOrigin(requestUrl, getBaseUrl());\n }\n\n /**\n * Create a function that can check a URL's origin against a list of allowed/trusted origins.\n * The current location's origin is implicitly trusted.\n *\n * @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.\n *\n * @returns {Function} - A function that receives a URL (string or parsed URL object) and returns\n * whether it is of an allowed origin.\n */\n function urlIsAllowedOriginFactory(trustedOriginUrls) {\n var parsedAllowedOriginUrls = [originUrl].concat(trustedOriginUrls.map(urlResolve));\n\n /**\n * Check whether the specified URL (string or parsed URL object) has an origin that is allowed\n * based on a list of trusted-origin URLs. The current location's origin is implicitly\n * trusted.\n *\n * @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be\n * resolved or a parsed URL object).\n *\n * @returns {boolean} - Whether the specified URL is of an allowed origin.\n */\n return function urlIsAllowedOrigin(requestUrl) {\n var parsedUrl = urlResolve(requestUrl);\n return parsedAllowedOriginUrls.some(urlsAreSameOrigin.bind(null, parsedUrl));\n };\n }\n\n /**\n * Determine if two URLs share the same origin.\n *\n * @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of\n * a dictionary object returned by `urlResolve()`.\n * @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the form\n * of a dictionary object returned by `urlResolve()`.\n *\n * @returns {boolean} - True if both URLs have the same origin, and false otherwise.\n */\n function urlsAreSameOrigin(url1, url2) {\n url1 = urlResolve(url1);\n url2 = urlResolve(url2);\n return url1.protocol === url2.protocol && url1.host === url2.host;\n }\n\n /**\n * Returns the current document base URL.\n * @returns {string}\n */\n function getBaseUrl() {\n if (window.document.baseURI) {\n return window.document.baseURI;\n }\n\n // `document.baseURI` is available everywhere except IE\n if (!baseUrlParsingNode) {\n baseUrlParsingNode = window.document.createElement('a');\n baseUrlParsingNode.href = '.';\n\n // Work-around for IE bug described in Implementation Notes. The fix in `urlResolve()` is not\n // suitable here because we need to track changes to the base URL.\n baseUrlParsingNode = baseUrlParsingNode.cloneNode(false);\n }\n return baseUrlParsingNode.href;\n }\n\n /**\n * @ngdoc service\n * @name $window\n * @this\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In AngularJS we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope. Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n \n \n \n
\n \n \n
\n
\n \n it('should display the greeting in the input box', function() {\n element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n \n
\n */\n function $WindowProvider() {\n this.$get = valueFn(window);\n }\n\n /**\n * @name $$cookieReader\n * @requires $document\n *\n * @description\n * This is a private service for reading cookies used by $http and ngCookies\n *\n * @return {Object} a key/value map of the current cookies\n */\n function $$CookieReader($document) {\n var rawDocument = $document[0] || {};\n var lastCookies = {};\n var lastCookieString = '';\n function safeGetCookie(rawDocument) {\n try {\n return rawDocument.cookie || '';\n } catch (e) {\n return '';\n }\n }\n function safeDecodeURIComponent(str) {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n }\n return function () {\n var cookieArray, cookie, i, index, name;\n var currentCookieString = safeGetCookie(rawDocument);\n if (currentCookieString !== lastCookieString) {\n lastCookieString = currentCookieString;\n cookieArray = lastCookieString.split('; ');\n lastCookies = {};\n for (i = 0; i < cookieArray.length; i++) {\n cookie = cookieArray[i];\n index = cookie.indexOf('=');\n if (index > 0) {\n //ignore nameless cookies\n name = safeDecodeURIComponent(cookie.substring(0, index));\n // the first value that is seen for a cookie is the most\n // specific one. values for the same cookie name that\n // follow are for less specific paths.\n if (isUndefined(lastCookies[name])) {\n lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n };\n }\n $$CookieReader.$inject = ['$document'];\n\n /** @this */\n function $$CookieReaderProvider() {\n this.$get = $$CookieReader;\n }\n\n /* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n /**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n *
\n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
\n *\n * ```js\n * // Filter registration\n * function MyModule($provide, $filterProvider) {\n * // create a service to demonstrate injection (not always needed)\n * $provide.value('greet', function(name){\n * return 'Hello ' + name + '!';\n * });\n *\n * // register a filter factory which uses the\n * // greet service to demonstrate DI.\n * $filterProvider.register('greet', function(greet){\n * // return the filter function which uses the greet service\n * // to generate salutation\n * return function(text) {\n * // filters need to be forgiving so check input validity\n * return text && greet(text) || text;\n * };\n * });\n * }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n * it('should be the same instance', inject(\n * function($filterProvider) {\n * $filterProvider.register('reverse', function(){\n * return ...;\n * });\n * },\n * function($filter, reverseFilter) {\n * expect($filter('reverse')).toBe(reverseFilter);\n * });\n * ```\n *\n *\n * For more information about how AngularJS filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the AngularJS Developer Guide.\n */\n\n /**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * They can be used in view templates, controllers or services. AngularJS comes\n * with a collection of [built-in filters](api/ng/filter), but it is easy to\n * define your own as well.\n *\n * The general syntax in templates is as follows:\n *\n * ```html\n * {{ expression [| filter_name[:parameter_value] ... ] }}\n * ```\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n \n \n
\n

{{ originalText }}

\n

{{ filteredText }}

\n
\n
\n \n \n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n \n
\n */\n $FilterProvider.$inject = ['$provide'];\n /** @this */\n function $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc method\n * @name $filterProvider#register\n * @param {string|Object} name Name of the filter function, or an object map of filters where\n * the keys are the filter names and the values are the filter factories.\n *\n *
\n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
\n * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.\n * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n * of the registered filter instances.\n */\n function register(name, factory) {\n if (isObject(name)) {\n var filters = {};\n forEach(name, function (filter, key) {\n filters[key] = register(key, filter);\n });\n return filters;\n } else {\n return $provide.factory(name + suffix, factory);\n }\n }\n this.register = register;\n this.$get = ['$injector', function ($injector) {\n return function (name) {\n return $injector.get(name + suffix);\n };\n }];\n\n ////////////////////////////////////////\n\n /* global\n currencyFilter: false,\n dateFilter: false,\n filterFilter: false,\n jsonFilter: false,\n limitToFilter: false,\n lowercaseFilter: false,\n numberFilter: false,\n orderByFilter: false,\n uppercaseFilter: false\n */\n\n register('currency', currencyFilter);\n register('date', dateFilter);\n register('filter', filterFilter);\n register('json', jsonFilter);\n register('limitTo', limitToFilter);\n register('lowercase', lowercaseFilter);\n register('number', numberFilter);\n register('orderBy', orderByFilter);\n register('uppercase', uppercaseFilter);\n }\n\n /**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n *
\n * **Note**: If the array contains objects that reference themselves, filtering is not possible.\n *
\n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n * `array`.\n *\n * Can be one of:\n *\n * - `string`: The string is used for matching against the contents of the `array`. All strings or\n * objects with string properties in `array` that match this string will be returned. This also\n * applies to nested object properties.\n * The predicate can be negated by prefixing the string with `!`.\n *\n * - `Object`: A pattern object can be used to filter specific properties on objects contained\n * by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n * which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n * property name (`$` by default) can be used (e.g. as in `{$: \"text\"}`) to accept a match\n * against any property of the object or its nested object properties. That's equivalent to the\n * simple substring match with a `string` as described above. The special property name can be\n * overwritten, using the `anyPropertyKey` parameter.\n * The predicate can be negated by prefixing the string with `!`.\n * For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n * not containing \"M\".\n *\n * Note that a named property will match properties on the same level only, while the special\n * `$` property will match properties on the same level or deeper. E.g. an array item like\n * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n * **will** be matched by `{$: 'John'}`.\n *\n * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.\n * The function is called for each element of the array, with the element, its index, and\n * the entire array itself as arguments.\n *\n * The final result is an array of those elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|false} [comparator] Comparator which is used in\n * determining if values retrieved using `expression` (when it is not a function) should be\n * considered a match based on the expected value (from the filter expression) and actual\n * value (from the object in the array).\n *\n * Can be one of:\n *\n * - `function(actual, expected)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if both values should be considered equal.\n *\n * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n * This is essentially strict comparison of expected and actual.\n *\n * - `false`: A short hand for a function which will look for a substring match in a case\n * insensitive way. Primitive values are converted to strings. Objects are not compared against\n * primitives, unless they have a custom `toString` method (e.g. `Date` objects).\n *\n *\n * Defaults to `false`.\n *\n * @param {string} [anyPropertyKey] The special property name that matches against any property.\n * By default `$`.\n *\n * @example\n \n \n
\n \n \n
\n \n \n \n \n \n
NamePhone
{{friend.name}}{{friend.phone}}
\n
\n
\n
\n
\n
\n \n \n \n \n \n \n
NamePhone
{{friendObj.name}}{{friendObj.phone}}
\n \n \n var expectFriendNames = function(expectedNames, key) {\n element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n arr.forEach(function(wd, i) {\n expect(wd.getText()).toMatch(expectedNames[i]);\n });\n });\n };\n \n it('should search across all fields when filtering with a string', function() {\n var searchText = element(by.model('searchText'));\n searchText.clear();\n searchText.sendKeys('m');\n expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n \n searchText.clear();\n searchText.sendKeys('76');\n expectFriendNames(['John', 'Julie'], 'friend');\n });\n \n it('should search in specific fields when filtering with a predicate object', function() {\n var searchAny = element(by.model('search.$'));\n searchAny.clear();\n searchAny.sendKeys('i');\n expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n });\n it('should use a equal comparison when comparator is true', function() {\n var searchName = element(by.model('search.name'));\n var strict = element(by.model('strict'));\n searchName.clear();\n searchName.sendKeys('Julie');\n strict.click();\n expectFriendNames(['Julie'], 'friendObj');\n });\n \n \n */\n\n function filterFilter() {\n return function (array, expression, comparator, anyPropertyKey) {\n if (!isArrayLike(array)) {\n if (array == null) {\n return array;\n } else {\n throw minErr('filter')('notarray', 'Expected array but received: {0}', array);\n }\n }\n anyPropertyKey = anyPropertyKey || '$';\n var expressionType = getTypeForFilter(expression);\n var predicateFn;\n var matchAgainstAnyProp;\n switch (expressionType) {\n case 'function':\n predicateFn = expression;\n break;\n case 'boolean':\n case 'null':\n case 'number':\n case 'string':\n matchAgainstAnyProp = true;\n // falls through\n case 'object':\n predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n break;\n default:\n return array;\n }\n return Array.prototype.filter.call(array, predicateFn);\n };\n }\n\n // Helper functions for `filterFilter`\n function createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && anyPropertyKey in expression;\n var predicateFn;\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function (actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if (actual === null || expected === null) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || isObject(actual) && !hasCustomToString(actual)) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n predicateFn = function (item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n return predicateFn;\n }\n function deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {\n var actualType = getTypeForFilter(actual);\n var expectedType = getTypeForFilter(expected);\n if (expectedType === 'string' && expected.charAt(0) === '!') {\n return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp);\n } else if (isArray(actual)) {\n // In case `actual` is an array, consider it a match\n // if ANY of it's items matches `expected`\n return actual.some(function (item) {\n return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp);\n });\n }\n switch (actualType) {\n case 'object':\n var key;\n if (matchAgainstAnyProp) {\n for (key in actual) {\n // Under certain, rare, circumstances, key may not be a string and `charAt` will be undefined\n // See: https://github.com/angular/angular.js/issues/15644\n if (key.charAt && key.charAt(0) !== '$' && deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) {\n return true;\n }\n }\n return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false);\n } else if (expectedType === 'object') {\n for (key in expected) {\n var expectedVal = expected[key];\n if (isFunction(expectedVal) || isUndefined(expectedVal)) {\n continue;\n }\n var matchAnyProperty = key === anyPropertyKey;\n var actualVal = matchAnyProperty ? actual : actual[key];\n if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) {\n return false;\n }\n }\n return true;\n } else {\n return comparator(actual, expected);\n }\n case 'function':\n return false;\n default:\n return comparator(actual, expected);\n }\n }\n\n // Used for easily differentiating between `null` and actual `object`\n function getTypeForFilter(val) {\n return val === null ? 'null' : typeof val;\n }\n var MAX_DIGITS = 22;\n var DECIMAL_SEP = '.';\n var ZERO_CHAR = '0';\n\n /**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n \n \n \n
\n
\n default currency symbol ($): {{amount | currency}}
\n custom currency identifier (USD$): {{amount | currency:\"USD$\"}}
\n no fractions (0): {{amount | currency:\"USD$\":0}}\n
\n
\n \n it('should init with 1234.56', function() {\n expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n });\n it('should update', function() {\n if (browser.params.browser === 'safari') {\n // Safari does not understand the minus key. See\n // https://github.com/angular/protractor/issues/481\n return;\n }\n element(by.model('amount')).clear();\n element(by.model('amount')).sendKeys('-1234');\n expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');\n expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');\n });\n \n
\n */\n currencyFilter.$inject = ['$locale'];\n function currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function (amount, currencySymbol, fractionSize) {\n if (isUndefined(currencySymbol)) {\n currencySymbol = formats.CURRENCY_SYM;\n }\n if (isUndefined(fractionSize)) {\n fractionSize = formats.PATTERNS[1].maxFrac;\n }\n\n // If the currency symbol is empty, trim whitespace around the symbol\n var currencySymbolRe = !currencySymbol ? /\\s*\\u00A4\\s*/g : /\\u00A4/g;\n\n // if null or undefined pass it through\n return amount == null ? amount : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).replace(currencySymbolRe, currencySymbol);\n };\n }\n\n /**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is null or undefined, it will just be returned.\n * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively.\n * If the input is not a number an empty string is returned.\n *\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current\n * locale (e.g., in the en_US locale it will have \".\" as the decimal separator and\n * include \",\" group separators after each third digit).\n *\n * @example\n \n \n \n
\n
\n Default formatting: {{val | number}}
\n No fractions: {{val | number:0}}
\n Negative number: {{-val | number:4}}\n
\n
\n \n it('should format numbers', function() {\n expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n });\n \n it('should update', function() {\n element(by.model('val')).clear();\n element(by.model('val')).sendKeys('3374.333');\n expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n });\n \n
\n */\n numberFilter.$inject = ['$locale'];\n function numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function (number, fractionSize) {\n // if null or undefined pass it through\n return number == null ? number : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize);\n };\n }\n\n /**\n * Parse a number (as a string) into three components that can be used\n * for formatting the number.\n *\n * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/)\n *\n * @param {string} numStr The number to parse\n * @return {object} An object describing this number, containing the following keys:\n * - d : an array of digits containing leading zeros as necessary\n * - i : the number of the digits in `d` that are to the left of the decimal point\n * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d`\n *\n */\n function parse(numStr) {\n var exponent = 0,\n digits,\n numberOfIntegerDigits;\n var i, j, zeros;\n\n // Decimal point?\n if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;\n numberOfIntegerDigits += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (numberOfIntegerDigits < 0) {\n // There was no decimal point or exponent so it is an integer.\n numberOfIntegerDigits = numStr.length;\n }\n\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {/* empty */}\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n numberOfIntegerDigits = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;\n\n // Trailing zeros are insignificant so ignore them\n numberOfIntegerDigits -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n\n // If the number overflows the maximum allowed digits then use an exponent.\n if (numberOfIntegerDigits > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = numberOfIntegerDigits - 1;\n numberOfIntegerDigits = 1;\n }\n return {\n d: digits,\n e: exponent,\n i: numberOfIntegerDigits\n };\n }\n\n /**\n * Round the parsed number to the specified number of decimal places\n * This function changed the parsedNumber in-place\n */\n function roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = isUndefined(fractionSize) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.i, roundAt));\n\n // Set non-fractional digits beyond `roundAt` to 0\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.i = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var i = 1; i < roundAt; i++) digits[i] = 0;\n }\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.i++;\n }\n digits.unshift(1);\n parsedNumber.i++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function (carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n }\n\n /**\n * Format a number into a string\n * @param {number} number The number to format\n * @param {{\n * minFrac, // the minimum number of digits required in the fraction part of the number\n * maxFrac, // the maximum number of digits required in the fraction part of the number\n * gSize, // number of digits in each group of separated digits\n * lgSize, // number of digits in the last group of digits before the decimal separator\n * negPre, // the string to go in front of a negative number (e.g. `-` or `(`))\n * posPre, // the string to go in front of a positive number\n * negSuf, // the string to go after a negative number (e.g. `)`)\n * posSuf // the string to go after a positive number\n * }} pattern\n * @param {string} groupSep The string to separate groups of number (e.g. `,`)\n * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)\n * @param {[type]} fractionSize The size of the fractional part of the number\n * @return {string} The number formatted as a string\n */\n function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';\n var isInfinity = !isFinite(number);\n var isZero = false;\n var numStr = Math.abs(number) + '',\n formattedText = '',\n parsedNumber;\n if (isInfinity) {\n formattedText = '\\u221e';\n } else {\n parsedNumber = parse(numStr);\n roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);\n var digits = parsedNumber.d;\n var integerLen = parsedNumber.i;\n var exponent = parsedNumber.e;\n var decimals = [];\n isZero = digits.reduce(function (isZero, d) {\n return isZero && !d;\n }, true);\n\n // pad zeros for small numbers\n while (integerLen < 0) {\n digits.unshift(0);\n integerLen++;\n }\n\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n } else {\n decimals = digits;\n digits = [0];\n }\n\n // format the integer digits with grouping separators\n var groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(groupSep);\n\n // append the decimal digits\n if (decimals.length) {\n formattedText += decimalSep + decimals.join('');\n }\n if (exponent) {\n formattedText += 'e+' + exponent;\n }\n }\n if (number < 0 && !isZero) {\n return pattern.negPre + formattedText + pattern.negSuf;\n } else {\n return pattern.posPre + formattedText + pattern.posSuf;\n }\n }\n function padNumber(num, digits, trim, negWrap) {\n var neg = '';\n if (num < 0 || negWrap && num <= 0) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = '-';\n }\n }\n num = '' + num;\n while (num.length < digits) num = ZERO_CHAR + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n }\n function dateGetter(name, size, offset, trim, negWrap) {\n offset = offset || 0;\n return function (date) {\n var value = date['get' + name]();\n if (offset > 0 || value > -offset) {\n value += offset;\n }\n if (value === 0 && offset === -12) value = 12;\n return padNumber(value, size, trim, negWrap);\n };\n }\n function dateStrGetter(name, shortForm, standAlone) {\n return function (date, formats) {\n var value = date['get' + name]();\n var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : '');\n var get = uppercase(propPrefix + name);\n return formats[get][value];\n };\n }\n function timeZoneGetter(date, formats, offset) {\n var zone = -1 * offset;\n var paddedZone = zone >= 0 ? '+' : '';\n paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2);\n return paddedZone;\n }\n function getFirstThursdayOfYear(year) {\n // 0 = index of January\n var dayOfWeekOnFirst = new Date(year, 0, 1).getDay();\n // 4 = index of Thursday (+1 to account for 1st = 5)\n // 11 = index of *next* Thursday (+1 account for 1st = 12)\n return new Date(year, 0, (dayOfWeekOnFirst <= 4 ? 5 : 12) - dayOfWeekOnFirst);\n }\n function getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(),\n // 4 = index of Thursday\n datetime.getDate() + (4 - datetime.getDay()));\n }\n function weekGetter(size) {\n return function (date) {\n var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n thisThurs = getThursdayThisWeek(date);\n var diff = +thisThurs - +firstThurs,\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n return padNumber(result, size);\n };\n }\n function ampmGetter(date, formats) {\n return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n }\n function eraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];\n }\n function longEraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];\n }\n var DATE_FORMATS = {\n yyyy: dateGetter('FullYear', 4, 0, false, true),\n yy: dateGetter('FullYear', 2, 0, true, true),\n y: dateGetter('FullYear', 1, 0, false, true),\n MMMM: dateStrGetter('Month'),\n MMM: dateStrGetter('Month', true),\n MM: dateGetter('Month', 2, 1),\n M: dateGetter('Month', 1, 1),\n LLLL: dateStrGetter('Month', false, true),\n dd: dateGetter('Date', 2),\n d: dateGetter('Date', 1),\n HH: dateGetter('Hours', 2),\n H: dateGetter('Hours', 1),\n hh: dateGetter('Hours', 2, -12),\n h: dateGetter('Hours', 1, -12),\n mm: dateGetter('Minutes', 2),\n m: dateGetter('Minutes', 1),\n ss: dateGetter('Seconds', 2),\n s: dateGetter('Seconds', 1),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n sss: dateGetter('Milliseconds', 3),\n EEEE: dateStrGetter('Day'),\n EEE: dateStrGetter('Day', true),\n a: ampmGetter,\n Z: timeZoneGetter,\n ww: weekGetter(2),\n w: weekGetter(1),\n G: eraGetter,\n GG: eraGetter,\n GGG: eraGetter,\n GGGG: longEraGetter\n };\n var DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\\s\\S]*)/,\n NUMBER_STRING = /^-?\\d+$/;\n\n /**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n * Formats `date` to a string based on the requested `format`.\n *\n * `format` string can be composed of the following elements:\n *\n * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n * * `'MMMM'`: Month in year (January-December)\n * * `'MMM'`: Month in year (Jan-Dec)\n * * `'MM'`: Month in year, padded (01-12)\n * * `'M'`: Month in year (1-12)\n * * `'LLLL'`: Stand-alone month in year (January-December)\n * * `'dd'`: Day in month, padded (01-31)\n * * `'d'`: Day in month (1-31)\n * * `'EEEE'`: Day in Week,(Sunday-Saturday)\n * * `'EEE'`: Day in Week, (Sun-Sat)\n * * `'HH'`: Hour in day, padded (00-23)\n * * `'H'`: Hour in day (0-23)\n * * `'hh'`: Hour in AM/PM, padded (01-12)\n * * `'h'`: Hour in AM/PM, (1-12)\n * * `'mm'`: Minute in hour, padded (00-59)\n * * `'m'`: Minute in hour (0-59)\n * * `'ss'`: Second in minute, padded (00-59)\n * * `'s'`: Second in minute (0-59)\n * * `'sss'`: Millisecond in second, padded (000-999)\n * * `'a'`: AM/PM marker\n * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')\n * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')\n *\n * `format` string can also be one of the following predefined\n * {@link guide/i18n localizable formats}:\n *\n * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n * (e.g. Sep 3, 2010 12:05:08 PM)\n * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM)\n * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale\n * (e.g. Friday, September 3, 2010)\n * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)\n * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)\n * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n * (e.g. `\"h 'o''clock'\"`).\n *\n * Any other characters in the `format` string will be output as-is.\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n * specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n * `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n \n \n {{1288323623006 | date:'medium'}}:\n {{1288323623006 | date:'medium'}}
\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
\n {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
\n {{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}:\n {{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}
\n
\n \n it('should format date', function() {\n expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n toMatch(/2010-10-2\\d \\d{2}:\\d{2}:\\d{2} (-|\\+)?\\d{4}/);\n expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n });\n \n
\n */\n dateFilter.$inject = ['$locale'];\n function dateFilter($locale) {\n var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n // 1 2 3 4 5 6 7 8 9 10 11\n function jsonStringToDate(string) {\n var match;\n if (match = string.match(R_ISO8601_STR)) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n var h = toInt(match[4] || 0) - tzHour;\n var m = toInt(match[5] || 0) - tzMin;\n var s = toInt(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }\n return string;\n }\n return function (date, format, timezone) {\n var text = '',\n parts = [],\n fn,\n match;\n format = format || 'mediumDate';\n format = $locale.DATETIME_FORMATS[format] || format;\n if (isString(date)) {\n date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);\n }\n if (isNumber(date)) {\n date = new Date(date);\n }\n if (!isDate(date) || !isFinite(date.getTime())) {\n return date;\n }\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = concat(parts, match, 1);\n format = parts.pop();\n } else {\n parts.push(format);\n format = null;\n }\n }\n var dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n forEach(parts, function (value) {\n fn = DATE_FORMATS[value];\n text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset) : value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n return text;\n };\n }\n\n /**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n * Allows you to convert a JavaScript object into JSON string.\n *\n * This filter is mostly useful for debugging. When using the double curly {{value}} notation\n * the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n \n \n
{{ {'name':'value'} | json }}
\n
{{ {'name':'value'} | json:4 }}
\n
\n \n it('should jsonify filtered objects', function() {\n expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n {2}\"name\": ?\"value\"\\n}/);\n expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n {4}\"name\": ?\"value\"\\n}/);\n });\n \n
\n *\n */\n function jsonFilter() {\n return function (object, spacing) {\n if (isUndefined(spacing)) {\n spacing = 2;\n }\n return toJson(object, spacing);\n };\n }\n\n /**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n *\n * See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example.\n *\n * @see angular.lowercase\n */\n var lowercaseFilter = valueFn(lowercase);\n\n /**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @example\n \n \n \n
\n \n

{{title}}

\n \n

{{title | uppercase}}

\n
\n
\n
\n */\n var uppercaseFilter = valueFn(uppercase);\n\n /**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements are\n * taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported\n * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input,\n * it is converted to a string.\n *\n * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited.\n * @param {string|number} limit - The length of the returned array or string. If the `limit` number\n * is positive, `limit` number of items from the beginning of the source array/string are copied.\n * If the number is negative, `limit` number of items from the end of the source array/string\n * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,\n * the input will be returned unchanged.\n * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index,\n * `begin` indicates an offset from the end of `input`. Defaults to `0`.\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had\n * less than `limit` elements.\n *\n * @example\n \n \n \n
\n \n

Output numbers: {{ numbers | limitTo:numLimit }}

\n \n

Output letters: {{ letters | limitTo:letterLimit }}

\n \n

Output long number: {{ longNumber | limitTo:longNumberLimit }}

\n
\n
\n \n var numLimitInput = element(by.model('numLimit'));\n var letterLimitInput = element(by.model('letterLimit'));\n var longNumberLimitInput = element(by.model('longNumberLimit'));\n var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n \n it('should limit the number array to first three items', function() {\n expect(numLimitInput.getAttribute('value')).toBe('3');\n expect(letterLimitInput.getAttribute('value')).toBe('3');\n expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n expect(limitedLetters.getText()).toEqual('Output letters: abc');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n });\n \n // There is a bug in safari and protractor that doesn't like the minus key\n // it('should update the output when -3 is entered', function() {\n // numLimitInput.clear();\n // numLimitInput.sendKeys('-3');\n // letterLimitInput.clear();\n // letterLimitInput.sendKeys('-3');\n // longNumberLimitInput.clear();\n // longNumberLimitInput.sendKeys('-3');\n // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n // expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n // expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n // });\n \n it('should not exceed the maximum size of input array', function() {\n numLimitInput.clear();\n numLimitInput.sendKeys('100');\n letterLimitInput.clear();\n letterLimitInput.sendKeys('100');\n longNumberLimitInput.clear();\n longNumberLimitInput.sendKeys('100');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n });\n \n
\n */\n function limitToFilter() {\n return function (input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = toInt(limit);\n }\n if (isNumberNaN(limit)) return input;\n if (isNumber(input)) input = input.toString();\n if (!isArrayLike(input)) return input;\n begin = !begin || isNaN(begin) ? 0 : toInt(begin);\n begin = begin < 0 ? Math.max(0, input.length + begin) : begin;\n if (limit >= 0) {\n return sliceFn(input, begin, begin + limit);\n } else {\n if (begin === 0) {\n return sliceFn(input, limit, input.length);\n } else {\n return sliceFn(input, Math.max(0, begin + limit), begin);\n }\n }\n };\n }\n function sliceFn(input, begin, end) {\n if (isString(input)) return input.slice(begin, end);\n return slice.call(input, begin, end);\n }\n\n /**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Returns an array containing the items from the specified `collection`, ordered by a `comparator`\n * function based on the values computed using the `expression` predicate.\n *\n * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in\n * `[{id: 'bar'}, {id: 'foo'}]`.\n *\n * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray,\n * String, etc).\n *\n * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker\n * for the preceding one. The `expression` is evaluated against each item and the output is used\n * for comparing with other items.\n *\n * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in\n * ascending order.\n *\n * The comparison is done using the `comparator` function. If none is specified, a default, built-in\n * comparator is used (see below for details - in a nutshell, it compares numbers numerically and\n * strings alphabetically).\n *\n * ### Under the hood\n *\n * Ordering the specified `collection` happens in two phases:\n *\n * 1. All items are passed through the predicate (or predicates), and the returned values are saved\n * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed\n * through a predicate that extracts the value of the `label` property, would be transformed to:\n * ```\n * {\n * value: 'foo',\n * type: 'string',\n * index: ...\n * }\n * ```\n * **Note:** `null` values use `'null'` as their type.\n * 2. The comparator function is used to sort the items, based on the derived values, types and\n * indices.\n *\n * If you use a custom comparator, it will be called with pairs of objects of the form\n * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal\n * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the\n * second, or `1` otherwise.\n *\n * In order to ensure that the sorting will be deterministic across platforms, if none of the\n * specified predicates can distinguish between two items, `orderBy` will automatically introduce a\n * dummy predicate that returns the item's index as `value`.\n * (If you are using a custom comparator, make sure it can handle this predicate as well.)\n *\n * If a custom comparator still can't distinguish between two items, then they will be sorted based\n * on their index using the built-in comparator.\n *\n * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted\n * value for an item, `orderBy` will try to convert that object to a primitive value, before passing\n * it to the comparator. The following rules govern the conversion:\n *\n * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be\n * used instead.
\n * (If the object has a `valueOf()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that\n * returns a primitive, its return value will be used instead.
\n * (If the object has a `toString()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 3. No conversion; the object itself is used.\n *\n * ### The default comparator\n *\n * The default, built-in comparator should be sufficient for most usecases. In short, it compares\n * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to\n * using their index in the original collection, sorts values of different types by type and puts\n * `undefined` and `null` values at the end of the sorted list.\n *\n * More specifically, it follows these steps to determine the relative order of items:\n *\n * 1. If the compared values are of different types:\n * - If one of the values is undefined, consider it \"greater than\" the other.\n * - Else if one of the values is null, consider it \"greater than\" the other.\n * - Else compare the types themselves alphabetically.\n * 2. If both values are of type `string`, compare them alphabetically in a case- and\n * locale-insensitive way.\n * 3. If both values are objects, compare their indices instead.\n * 4. Otherwise, return:\n * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`).\n * - `-1`, if the 1st value is \"less than\" the 2nd value (compared using the `<` operator).\n * - `1`, otherwise.\n *\n * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being\n * saved as numbers and not strings.\n * **Note:** For the purpose of sorting, `null` and `undefined` are considered \"greater than\"\n * any other value (with undefined \"greater than\" null). This effectively means that `null`\n * and `undefined` values end up at the end of a list sorted in ascending order.\n * **Note:** `null` values use `'null'` as their type to be able to distinguish them from objects.\n *\n * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort.\n * @param {(Function|string|Array.)=} expression - A predicate (or list of\n * predicates) to be used by the comparator to determine the order of elements.\n *\n * Can be one of:\n *\n * - `Function`: A getter function. This function will be called with each item as argument and\n * the return value will be used for sorting.\n * - `string`: An AngularJS expression. This expression will be evaluated against each item and the\n * result will be used for sorting. For example, use `'label'` to sort by a property called\n * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label`\n * property.
\n * (The result of a constant expression is interpreted as a property name to be used for\n * comparison. For example, use `'\"special name\"'` (note the extra pair of quotes) to sort by a\n * property called `special name`.)
\n * An expression can be optionally prefixed with `+` or `-` to control the sorting direction,\n * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided,\n * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons.\n * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the\n * relative order of two items, the next predicate is used as a tie-breaker.\n *\n * **Note:** If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse - If `true`, reverse the sorting order.\n * @param {(Function)=} comparator - The comparator function used to determine the relative order of\n * value pairs. If omitted, the built-in comparator will be used.\n *\n * @returns {Array} - The sorted array.\n *\n *\n * @example\n * ### Ordering a table with `ngRepeat`\n *\n * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by\n * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means\n * it defaults to the built-in comparator.\n *\n \n \n
\n \n \n \n \n \n \n \n \n \n \n \n
NamePhone NumberAge
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \n angular.module('orderByExample1', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n \n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var names = element.all(by.repeater('friends').column('friend.name'));\n \n it('should sort friends by age in reverse order', function() {\n expect(names.get(0).getText()).toBe('Adam');\n expect(names.get(1).getText()).toBe('Julie');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('John');\n });\n \n
\n *
\n *\n * @example\n * ### Changing parameters dynamically\n *\n * All parameters can be changed dynamically. The next example shows how you can make the columns of\n * a table sortable, by binding the `expression` and `reverse` parameters to scope properties.\n *\n \n \n
\n
Sort by = {{propertyName}}; reverse = {{reverse}}
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \n angular.module('orderByExample2', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n \n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = friends;\n \n $scope.sortBy = function(propertyName) {\n $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n \n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n \n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n \n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n \n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n \n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
\n *
\n *\n * @example\n * ### Using `orderBy` inside a controller\n *\n * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and\n * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory\n * and retrieve the `orderBy` filter with `$filter('orderBy')`.)\n *\n \n \n
\n
Sort by = {{propertyName}}; reverse = {{reverse}}
\n
\n \n
\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
{{friend.name}}{{friend.phone}}{{friend.age}}
\n
\n
\n \n angular.module('orderByExample3', [])\n .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n \n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n \n $scope.sortBy = function(propertyName) {\n $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName)\n ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n \n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n \n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n \n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n \n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n \n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n \n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n \n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
\n *
\n *\n * @example\n * ### Using a custom comparator\n *\n * If you have very specific requirements about the way items are sorted, you can pass your own\n * comparator function. For example, you might need to compare some strings in a locale-sensitive\n * way. (When specifying a custom comparator, you also need to pass a value for the `reverse`\n * argument - passing `false` retains the default sorting order, i.e. ascending.)\n *\n \n \n
\n
\n

Locale-sensitive Comparator

\n \n \n \n \n \n \n \n \n \n
NameFavorite Letter
{{friend.name}}{{friend.favoriteLetter}}
\n
\n
\n

Default Comparator

\n \n \n \n \n \n \n \n \n \n
NameFavorite Letter
{{friend.name}}{{friend.favoriteLetter}}
\n
\n
\n
\n \n angular.module('orderByExample4', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', favoriteLetter: 'Ä'},\n {name: 'Mary', favoriteLetter: 'Ü'},\n {name: 'Mike', favoriteLetter: 'Ö'},\n {name: 'Adam', favoriteLetter: 'H'},\n {name: 'Julie', favoriteLetter: 'Z'}\n ];\n \n $scope.localeSensitiveComparator = function(v1, v2) {\n // If we don't get strings, just compare by index\n if (v1.type !== 'string' || v2.type !== 'string') {\n return (v1.index < v2.index) ? -1 : 1;\n }\n \n // Compare strings alphabetically, taking locale into account\n return v1.value.localeCompare(v2.value);\n };\n }]);\n \n \n .friends-container {\n display: inline-block;\n margin: 0 30px;\n }\n \n .friends {\n border-collapse: collapse;\n }\n \n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var container = element(by.css('.custom-comparator'));\n var names = container.all(by.repeater('friends').column('friend.name'));\n \n it('should sort friends by favorite letter (in correct alphabetical order)', function() {\n expect(names.get(0).getText()).toBe('John');\n expect(names.get(1).getText()).toBe('Adam');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('Julie');\n });\n \n
\n *\n */\n orderByFilter.$inject = ['$parse'];\n function orderByFilter($parse) {\n return function (array, sortPredicate, reverseOrder, compareFn) {\n if (array == null) return array;\n if (!isArrayLike(array)) {\n throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);\n }\n if (!isArray(sortPredicate)) {\n sortPredicate = [sortPredicate];\n }\n if (sortPredicate.length === 0) {\n sortPredicate = ['+'];\n }\n var predicates = processPredicates(sortPredicate);\n var descending = reverseOrder ? -1 : 1;\n\n // Define the `compare()` function. Use a default comparator if none is specified.\n var compare = isFunction(compareFn) ? compareFn : defaultCompare;\n\n // The next three lines are a version of a Swartzian Transform idiom from Perl\n // (sometimes called the Decorate-Sort-Undecorate idiom)\n // See https://en.wikipedia.org/wiki/Schwartzian_transform\n var compareValues = Array.prototype.map.call(array, getComparisonObject);\n compareValues.sort(doComparison);\n array = compareValues.map(function (item) {\n return item.value;\n });\n return array;\n function getComparisonObject(value, index) {\n // NOTE: We are adding an extra `tieBreaker` value based on the element's index.\n // This will be used to keep the sort stable when none of the input predicates can\n // distinguish between two elements.\n return {\n value: value,\n tieBreaker: {\n value: index,\n type: 'number',\n index: index\n },\n predicateValues: predicates.map(function (predicate) {\n return getPredicateValue(predicate.get(value), index);\n })\n };\n }\n function doComparison(v1, v2) {\n for (var i = 0, ii = predicates.length; i < ii; i++) {\n var result = compare(v1.predicateValues[i], v2.predicateValues[i]);\n if (result) {\n return result * predicates[i].descending * descending;\n }\n }\n return (compare(v1.tieBreaker, v2.tieBreaker) || defaultCompare(v1.tieBreaker, v2.tieBreaker)) * descending;\n }\n };\n function processPredicates(sortPredicates) {\n return sortPredicates.map(function (predicate) {\n var descending = 1,\n get = identity;\n if (isFunction(predicate)) {\n get = predicate;\n } else if (isString(predicate)) {\n if (predicate.charAt(0) === '+' || predicate.charAt(0) === '-') {\n descending = predicate.charAt(0) === '-' ? -1 : 1;\n predicate = predicate.substring(1);\n }\n if (predicate !== '') {\n get = $parse(predicate);\n if (get.constant) {\n var key = get();\n get = function (value) {\n return value[key];\n };\n }\n }\n }\n return {\n get: get,\n descending: descending\n };\n });\n }\n function isPrimitive(value) {\n switch (typeof value) {\n case 'number': /* falls through */\n case 'boolean': /* falls through */\n case 'string':\n return true;\n default:\n return false;\n }\n }\n function objectValue(value) {\n // If `valueOf` is a valid function use that\n if (isFunction(value.valueOf)) {\n value = value.valueOf();\n if (isPrimitive(value)) return value;\n }\n // If `toString` is a valid function and not the one from `Object.prototype` use that\n if (hasCustomToString(value)) {\n value = value.toString();\n if (isPrimitive(value)) return value;\n }\n return value;\n }\n function getPredicateValue(value, index) {\n var type = typeof value;\n if (value === null) {\n type = 'null';\n } else if (type === 'object') {\n value = objectValue(value);\n }\n return {\n value: value,\n type: type,\n index: index\n };\n }\n function defaultCompare(v1, v2) {\n var result = 0;\n var type1 = v1.type;\n var type2 = v2.type;\n if (type1 === type2) {\n var value1 = v1.value;\n var value2 = v2.value;\n if (type1 === 'string') {\n // Compare strings case-insensitively\n value1 = value1.toLowerCase();\n value2 = value2.toLowerCase();\n } else if (type1 === 'object') {\n // For basic objects, use the position of the object\n // in the collection instead of the value\n if (isObject(value1)) value1 = v1.index;\n if (isObject(value2)) value2 = v2.index;\n }\n if (value1 !== value2) {\n result = value1 < value2 ? -1 : 1;\n }\n } else {\n result = type1 === 'undefined' ? 1 : type2 === 'undefined' ? -1 : type1 === 'null' ? 1 : type2 === 'null' ? -1 : type1 < type2 ? -1 : 1;\n }\n return result;\n }\n }\n function ngDirective(directive) {\n if (isFunction(directive)) {\n directive = {\n link: directive\n };\n }\n directive.restrict = directive.restrict || 'AC';\n return valueFn(directive);\n }\n\n /**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html a tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive.\n */\n var htmlAnchorDirective = valueFn({\n restrict: 'E',\n compile: function (element, attr) {\n if (!attr.href && !attr.xlinkHref) {\n return function (scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ? 'xlink:href' : 'href';\n element.on('click', function (event) {\n // if we have no href url, then don't navigate anywhere.\n if (!element.attr(href)) {\n event.preventDefault();\n }\n });\n };\n }\n }\n });\n\n /**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * AngularJS has a chance to replace the `{{hash}}` markup with its\n * value. Until AngularJS replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * link1\n * ```\n *\n * The correct way to write it:\n * ```html\n * link1\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n \n \n
\n link 1 (link, don't reload)
\n link 2 (link, don't reload)
\n link 3 (link, reload!)
\n anchor (link, don't reload)
\n anchor (no link)
\n link (link, change location)\n
\n \n it('should execute ng-click but not reload when href without value', function() {\n element(by.id('link-1')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n });\n \n it('should execute ng-click but not reload when href empty string', function() {\n element(by.id('link-2')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n });\n \n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n \n element(by.id('link-3')).click();\n \n // At this point, we navigate away from an AngularJS page, so we need\n // to use browser.driver to get the base webdriver.\n \n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/123$/);\n });\n }, 5000, 'page should navigate to /123');\n });\n \n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element(by.id('link-4')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n });\n \n it('should execute ng-click but not reload when no href but name specified', function() {\n element(by.id('link-5')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n });\n \n it('should only change url when only ng-href', function() {\n element(by.model('value')).clear();\n element(by.model('value')).sendKeys('6');\n expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n \n element(by.id('link-6')).click();\n \n // At this point, we navigate away from an AngularJS page, so we need\n // to use browser.driver to get the base webdriver.\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/6$/);\n });\n }, 5000, 'page should navigate to /6');\n });\n \n
\n */\n\n /**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n /**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n /**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * This directive sets the `disabled` attribute on the element (typically a form control,\n * e.g. `input`, `button`, `select` etc.) if the\n * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `disabled`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
\n \n
\n \n it('should toggle button', function() {\n expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n });\n \n
\n *\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n * then the `disabled` attribute will be set on the element\n */\n\n /**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.\n *\n * Note that this directive should not be used together with {@link ngModel `ngModel`},\n * as this can lead to unexpected behavior.\n *\n * A special directive is necessary because we cannot use interpolation inside the `checked`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
\n \n
\n \n it('should check both checkBoxes', function() {\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy();\n element(by.model('leader')).click();\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy();\n });\n \n
\n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n * then the `checked` attribute will be set on the element\n */\n\n /**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy.\n * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on\n * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information.\n *\n * A special directive is necessary because we cannot use interpolation inside the `readonly`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
\n \n
\n \n it('should toggle readonly attr', function() {\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n });\n \n
\n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n * then special attribute \"readonly\" will be set on the element\n */\n\n /**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `selected`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n *
\n * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only\n * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you\n * should not use `ngSelected` on the options, as `ngModel` will set the select value and\n * selected options.\n *
\n *\n * @example\n \n \n
\n \n
\n \n it('should select Greetings!', function() {\n expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n element(by.model('selected')).click();\n expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n });\n \n
\n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n * then special attribute \"selected\" will be set on the element\n */\n\n /**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `open`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * ## A note about browser compatibility\n *\n * Internet Explorer and Edge do not support the `details` element, it is\n * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead.\n *\n * @example\n \n \n
\n
\n List\n
    \n
  • Apple
  • \n
  • Orange
  • \n
  • Durian
  • \n
\n
\n
\n \n it('should toggle open', function() {\n expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n element(by.model('open')).click();\n expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n });\n \n
\n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n * then special attribute \"open\" will be set on the element\n */\n\n var ngAttributeAliasDirectives = {};\n\n // boolean attrs are evaluated\n forEach(BOOLEAN_ATTR, function (propName, attrName) {\n // binding to multiple is not supported\n if (propName === 'multiple') return;\n function defaultLinkFn(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n }\n var normalized = directiveNormalize('ng-' + attrName);\n var linkFn = defaultLinkFn;\n if (propName === 'checked') {\n linkFn = function (scope, element, attr) {\n // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input\n if (attr.ngModel !== attr[normalized]) {\n defaultLinkFn(scope, element, attr);\n }\n };\n }\n ngAttributeAliasDirectives[normalized] = function () {\n return {\n restrict: 'A',\n priority: 100,\n link: linkFn\n };\n };\n });\n\n // aliased input attrs are evaluated\n forEach(ALIASED_ATTR, function (htmlAttr, ngAttr) {\n ngAttributeAliasDirectives[ngAttr] = function () {\n return {\n priority: 100,\n link: function (scope, element, attr) {\n //special case ngPattern when a literal regular expression value\n //is used as the expression (this way we don't have to watch anything).\n if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') {\n var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n if (match) {\n attr.$set('ngPattern', new RegExp(match[1], match[2]));\n return;\n }\n }\n scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n attr.$set(ngAttr, value);\n });\n }\n };\n };\n });\n\n // ng-src, ng-srcset, ng-href are interpolated\n forEach(['src', 'srcset', 'href'], function (attrName) {\n var normalized = directiveNormalize('ng-' + attrName);\n ngAttributeAliasDirectives[normalized] = ['$sce', function ($sce) {\n return {\n priority: 99,\n // it needs to run after the attributes are interpolated\n link: function (scope, element, attr) {\n var propName = attrName,\n name = attrName;\n if (attrName === 'href' && toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n name = 'xlinkHref';\n attr.$attr[name] = 'xlink:href';\n propName = null;\n }\n\n // We need to sanitize the url at least once, in case it is a constant\n // non-interpolated attribute.\n attr.$set(normalized, $sce.getTrustedMediaUrl(attr[normalized]));\n attr.$observe(normalized, function (value) {\n if (!value) {\n if (attrName === 'href') {\n attr.$set(name, null);\n }\n return;\n }\n attr.$set(name, value);\n\n // Support: IE 9-11 only\n // On IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n // to set the property as well to achieve the desired effect.\n // We use attr[attrName] value since $set might have sanitized the url.\n if (msie && propName) element.prop(propName, attr[name]);\n });\n }\n };\n }];\n });\n\n /* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS\n */\n var nullFormCtrl = {\n $addControl: noop,\n $getControls: valueFn([]),\n $$renameControl: nullFormRenameControl,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop,\n $setSubmitted: noop,\n $$setSubmitted: noop\n },\n PENDING_CLASS = 'ng-pending',\n SUBMITTED_CLASS = 'ng-submitted';\n function nullFormRenameControl(control, name) {\n control.$name = name;\n }\n\n /**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $pending An object hash, containing references to controls or forms with\n * pending validators, where:\n *\n * - keys are validations tokens (error names).\n * - values are arrays of controls or forms that have a pending validator for the given error name.\n *\n * See {@link form.FormController#$error $error} for a list of built-in validation tokens.\n *\n * @property {Object} $error An object hash, containing references to controls or forms with failing\n * validators, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that have a failing validator for the given error name.\n *\n * Built-in validation tokens:\n * - `email`\n * - `max`\n * - `maxlength`\n * - `min`\n * - `minlength`\n * - `number`\n * - `pattern`\n * - `required`\n * - `url`\n * - `date`\n * - `datetimelocal`\n * - `time`\n * - `week`\n * - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n //asks for $scope to fool the BC controller module\n FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\n function FormController($element, $attrs, $scope, $animate, $interpolate) {\n this.$$controls = [];\n\n // init state\n this.$error = {};\n this.$$success = {};\n this.$pending = undefined;\n this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope);\n this.$dirty = false;\n this.$pristine = true;\n this.$valid = true;\n this.$invalid = false;\n this.$submitted = false;\n this.$$parentForm = nullFormCtrl;\n this.$$element = $element;\n this.$$animate = $animate;\n setupValidity(this);\n }\n FormController.prototype = {\n /**\n * @ngdoc method\n * @name form.FormController#$rollbackViewValue\n *\n * @description\n * Rollback all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is typically needed by the reset button of\n * a form that uses `ng-model-options` to pend updates.\n */\n $rollbackViewValue: function () {\n forEach(this.$$controls, function (control) {\n control.$rollbackViewValue();\n });\n },\n /**\n * @ngdoc method\n * @name form.FormController#$commitViewValue\n *\n * @description\n * Commit all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function () {\n forEach(this.$$controls, function (control) {\n control.$commitViewValue();\n });\n },\n /**\n * @ngdoc method\n * @name form.FormController#$addControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Register a control with the form. Input elements using ngModelController do this automatically\n * when they are linked.\n *\n * Note that the current state of the control will not be reflected on the new parent form. This\n * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`\n * state.\n *\n * However, if the method is used programmatically, for example by adding dynamically created controls,\n * or controls that have been previously removed without destroying their corresponding DOM element,\n * it's the developers responsibility to make sure the current state propagates to the parent form.\n *\n * For example, if an input control is added that is already `$dirty` and has `$error` properties,\n * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.\n */\n $addControl: function (control) {\n // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n // and not added to the scope. Now we throw an error.\n assertNotHasOwnProperty(control.$name, 'input');\n this.$$controls.push(control);\n if (control.$name) {\n this[control.$name] = control;\n }\n control.$$parentForm = this;\n },\n /**\n * @ngdoc method\n * @name form.FormController#$getControls\n * @returns {Array} the controls that are currently part of this form\n *\n * @description\n * This method returns a **shallow copy** of the controls that are currently part of this form.\n * The controls can be instances of {@link form.FormController `FormController`}\n * ({@link ngForm \"child-forms\"}) and of {@link ngModel.NgModelController `NgModelController`}.\n * If you need access to the controls of child-forms, you have to call `$getControls()`\n * recursively on them.\n * This can be used for example to iterate over all controls to validate them.\n *\n * The controls can be accessed normally, but adding to, or removing controls from the array has\n * no effect on the form. Instead, use {@link form.FormController#$addControl `$addControl()`} and\n * {@link form.FormController#$removeControl `$removeControl()`} for this use-case.\n * Likewise, adding a control to, or removing a control from the form is not reflected\n * in the shallow copy. That means you should get a fresh copy from `$getControls()` every time\n * you need access to the controls.\n */\n $getControls: function () {\n return shallowCopy(this.$$controls);\n },\n // Private API: rename a form control\n $$renameControl: function (control, newName) {\n var oldName = control.$name;\n if (this[oldName] === control) {\n delete this[oldName];\n }\n this[newName] = control;\n control.$name = newName;\n },\n /**\n * @ngdoc method\n * @name form.FormController#$removeControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Deregister a control from the form.\n *\n * Input elements using ngModelController do this automatically when they are destroyed.\n *\n * Note that only the removed control's validation state (`$errors`etc.) will be removed from the\n * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be\n * different from case to case. For example, removing the only `$dirty` control from a form may or\n * may not mean that the form is still `$dirty`.\n */\n $removeControl: function (control) {\n if (control.$name && this[control.$name] === control) {\n delete this[control.$name];\n }\n forEach(this.$pending, function (value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$error, function (value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$$success, function (value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n arrayRemove(this.$$controls, control);\n control.$$parentForm = nullFormCtrl;\n },\n /**\n * @ngdoc method\n * @name form.FormController#$setDirty\n *\n * @description\n * Sets the form to a dirty state.\n *\n * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n * state (ng-dirty class). This method will also propagate to parent forms.\n */\n $setDirty: function () {\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$dirty = true;\n this.$pristine = false;\n this.$$parentForm.$setDirty();\n },\n /**\n * @ngdoc method\n * @name form.FormController#$setPristine\n *\n * @description\n * Sets the form to its pristine state.\n *\n * This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes\n * the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted`\n * state to false.\n *\n * This method will also propagate to all the controls contained in this form.\n *\n * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n * saving or resetting it.\n */\n $setPristine: function () {\n this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n this.$dirty = false;\n this.$pristine = true;\n this.$submitted = false;\n forEach(this.$$controls, function (control) {\n control.$setPristine();\n });\n },\n /**\n * @ngdoc method\n * @name form.FormController#$setUntouched\n *\n * @description\n * Sets the form to its untouched state.\n *\n * This method can be called to remove the 'ng-touched' class and set the form controls to their\n * untouched state (ng-untouched class).\n *\n * Setting a form controls back to their untouched state is often useful when setting the form\n * back to its pristine state.\n */\n $setUntouched: function () {\n forEach(this.$$controls, function (control) {\n control.$setUntouched();\n });\n },\n /**\n * @ngdoc method\n * @name form.FormController#$setSubmitted\n *\n * @description\n * Sets the form to its `$submitted` state. This will also set `$submitted` on all child and\n * parent forms of the form.\n */\n $setSubmitted: function () {\n var rootForm = this;\n while (rootForm.$$parentForm && rootForm.$$parentForm !== nullFormCtrl) {\n rootForm = rootForm.$$parentForm;\n }\n rootForm.$$setSubmitted();\n },\n $$setSubmitted: function () {\n this.$$animate.addClass(this.$$element, SUBMITTED_CLASS);\n this.$submitted = true;\n forEach(this.$$controls, function (control) {\n if (control.$$setSubmitted) {\n control.$$setSubmitted();\n }\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name form.FormController#$setValidity\n *\n * @description\n * Change the validity state of the form, and notify the parent form (if any).\n *\n * Application developers will rarely need to call this method directly. It is used internally, by\n * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a\n * control's validity state to the parent `FormController`.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be\n * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for\n * unfulfilled `$asyncValidators`), so that it is available for data-binding. The\n * `validationErrorKey` should be in camelCase and will get converted into dash-case for\n * class name. Example: `myError` will result in `ng-valid-my-error` and\n * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending\n * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by AngularJS when validators do not run because of parse errors and when\n * `$asyncValidators` do not run because any of the `$validators` failed.\n * @param {NgModelController | FormController} controller - The controller whose validity state is\n * triggering the change.\n */\n addSetValidityMethod({\n clazz: FormController,\n set: function (object, property, controller) {\n var list = object[property];\n if (!list) {\n object[property] = [controller];\n } else {\n var index = list.indexOf(controller);\n if (index === -1) {\n list.push(controller);\n }\n }\n },\n unset: function (object, property, controller) {\n var list = object[property];\n if (!list) {\n return;\n }\n arrayRemove(list, controller);\n if (list.length === 0) {\n delete object[property];\n }\n }\n });\n\n /**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Helper directive that makes it possible to create control groups inside a\n * {@link ng.directive:form `form`} directive.\n * These \"child forms\" can be used, for example, to determine the validity of a sub-group of\n * controls.\n *\n *
\n * **Note**: `ngForm` cannot be used as a replacement for `
`, because it lacks its\n * [built-in HTML functionality](https://html.spec.whatwg.org/#the-form-element).\n * Specifically, you cannot submit `ngForm` like a `` tag. That means,\n * you cannot send data to the server with `ngForm`, or integrate it with\n * {@link ng.directive:ngSubmit `ngSubmit`}.\n *
\n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will\n * be published into the related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * ## Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In AngularJS, forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `` elements, so\n * AngularJS provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to\n * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group\n * of controls needs to be determined.\n *\n * ## CSS classes\n * - `ng-valid` is set if the form is valid.\n * - `ng-invalid` is set if the form is invalid.\n * - `ng-pending` is set if the form is pending.\n * - `ng-pristine` is set if the form is pristine.\n * - `ng-dirty` is set if the form is dirty.\n * - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * ## Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side AngularJS applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, AngularJS prevents the default action (form submission to the server) unless the\n * `` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n * button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * @animations\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n *
\n  * //be sure to include ngAnimate as a module to hook into more\n  * //advanced animations\n  * .my-form {\n  *   transition:0.5s linear all;\n  *   background: white;\n  * }\n  * .my-form.ng-invalid {\n  *   background: red;\n  *   color:white;\n  * }\n  * 
\n *\n * @example\n \n \n \n \n \n userType: \n Required!
\n userType = {{userType}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n \n
\n \n it('should initialize to model', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n expect(userType.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n it('should be invalid if empty', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n var userInput = element(by.model('userType'));\n userInput.clear();\n userInput.sendKeys('');\n expect(userType.getText()).toEqual('userType =');\n expect(valid.getText()).toContain('false');\n });\n \n
\n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n */\n var formDirectiveFactory = function (isNgForm) {\n return ['$timeout', '$parse', function ($timeout, $parse) {\n var formDirective = {\n name: 'form',\n restrict: isNgForm ? 'EAC' : 'E',\n require: ['form', '^^?form'],\n //first is the form's own ctrl, second is an optional parent form\n controller: FormController,\n compile: function ngFormCompile(formElement, attr) {\n // Setup initial state of the control\n formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n var nameAttr = attr.name ? 'name' : isNgForm && attr.ngForm ? 'ngForm' : false;\n return {\n pre: function ngFormPreLink(scope, formElement, attr, ctrls) {\n var controller = ctrls[0];\n\n // if `action` attr is not present on the form, prevent the default action (submission)\n if (!('action' in attr)) {\n // we can't use jq events because if a form is destroyed during submission the default\n // action is not prevented. see #1238\n //\n // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n // page reload if the form was destroyed by submission of the form via a click handler\n // on a button in the form. Looks like an IE9 specific bug.\n var handleFormSubmission = function (event) {\n scope.$apply(function () {\n controller.$commitViewValue();\n controller.$setSubmitted();\n });\n event.preventDefault();\n };\n formElement[0].addEventListener('submit', handleFormSubmission);\n\n // unregister the preventDefault listener so that we don't not leak memory but in a\n // way that will achieve the prevention of the default action.\n formElement.on('$destroy', function () {\n $timeout(function () {\n formElement[0].removeEventListener('submit', handleFormSubmission);\n }, 0, false);\n });\n }\n var parentFormCtrl = ctrls[1] || controller.$$parentForm;\n parentFormCtrl.$addControl(controller);\n var setter = nameAttr ? getSetter(controller.$name) : noop;\n if (nameAttr) {\n setter(scope, controller);\n attr.$observe(nameAttr, function (newValue) {\n if (controller.$name === newValue) return;\n setter(scope, undefined);\n controller.$$parentForm.$$renameControl(controller, newValue);\n setter = getSetter(controller.$name);\n setter(scope, controller);\n });\n }\n formElement.on('$destroy', function () {\n controller.$$parentForm.$removeControl(controller);\n setter(scope, undefined);\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n };\n }\n };\n return formDirective;\n function getSetter(expression) {\n if (expression === '') {\n //create an assignable expression, so forms with an empty name can be renamed later\n return $parse('this[\"\"]').assign;\n }\n return $parse(expression).assign || noop;\n }\n }];\n };\n var formDirective = formDirectiveFactory();\n var ngFormDirective = formDirectiveFactory(true);\n\n // helper methods\n function setupValidity(instance) {\n instance.$$classCache = {};\n instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS));\n }\n function addSetValidityMethod(context) {\n var clazz = context.clazz,\n set = context.set,\n unset = context.unset;\n clazz.prototype.$setValidity = function (validationErrorKey, state, controller) {\n if (isUndefined(state)) {\n createAndSet(this, '$pending', validationErrorKey, controller);\n } else {\n unsetAndCleanup(this, '$pending', validationErrorKey, controller);\n }\n if (!isBoolean(state)) {\n unset(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n } else {\n if (state) {\n unset(this.$error, validationErrorKey, controller);\n set(this.$$success, validationErrorKey, controller);\n } else {\n set(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n }\n }\n if (this.$pending) {\n cachedToggleClass(this, PENDING_CLASS, true);\n this.$valid = this.$invalid = undefined;\n toggleValidationCss(this, '', null);\n } else {\n cachedToggleClass(this, PENDING_CLASS, false);\n this.$valid = isObjectEmpty(this.$error);\n this.$invalid = !this.$valid;\n toggleValidationCss(this, '', this.$valid);\n }\n\n // re-read the state as the set/unset methods could have\n // combined state in this.$error[validationError] (used for forms),\n // where setting/unsetting only increments/decrements the value,\n // and does not replace it.\n var combinedState;\n if (this.$pending && this.$pending[validationErrorKey]) {\n combinedState = undefined;\n } else if (this.$error[validationErrorKey]) {\n combinedState = false;\n } else if (this.$$success[validationErrorKey]) {\n combinedState = true;\n } else {\n combinedState = null;\n }\n toggleValidationCss(this, validationErrorKey, combinedState);\n this.$$parentForm.$setValidity(validationErrorKey, combinedState, this);\n };\n function createAndSet(ctrl, name, value, controller) {\n if (!ctrl[name]) {\n ctrl[name] = {};\n }\n set(ctrl[name], value, controller);\n }\n function unsetAndCleanup(ctrl, name, value, controller) {\n if (ctrl[name]) {\n unset(ctrl[name], value, controller);\n }\n if (isObjectEmpty(ctrl[name])) {\n ctrl[name] = undefined;\n }\n }\n function cachedToggleClass(ctrl, className, switchValue) {\n if (switchValue && !ctrl.$$classCache[className]) {\n ctrl.$$animate.addClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = true;\n } else if (!switchValue && ctrl.$$classCache[className]) {\n ctrl.$$animate.removeClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = false;\n }\n }\n function toggleValidationCss(ctrl, validationErrorKey, isValid) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true);\n cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false);\n }\n }\n function isObjectEmpty(obj) {\n if (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n }\n return true;\n }\n\n /* global\n VALID_CLASS: false,\n INVALID_CLASS: false,\n PRISTINE_CLASS: false,\n DIRTY_CLASS: false,\n ngModelMinErr: false\n */\n\n // Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\n var ISO_DATE_REGEXP = /^\\d{4,}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+(?:[+-][0-2]\\d:[0-5]\\d|Z)$/;\n // See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)\n // Note: We are being more lenient, because browsers are too.\n // 1. Scheme\n // 2. Slashes\n // 3. Username\n // 4. Password\n // 5. Hostname\n // 6. Port\n // 7. Path\n // 8. Query\n // 9. Fragment\n // 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999\n var URL_REGEXP = /^[a-z][a-z\\d.+-]*:\\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\\s:/?#]+|\\[[a-f\\d:]+])(?::\\d+)?(?:\\/[^?#]*)?(?:\\?[^#]*)?(?:#.*)?$/i;\n // eslint-disable-next-line max-len\n var EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;\n var NUMBER_REGEXP = /^\\s*(-|\\+)?(\\d+|(\\d*(\\.\\d*)))([eE][+-]?\\d+)?\\s*$/;\n var DATE_REGEXP = /^(\\d{4,})-(\\d{2})-(\\d{2})$/;\n var DATETIMELOCAL_REGEXP = /^(\\d{4,})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n var WEEK_REGEXP = /^(\\d{4,})-W(\\d\\d)$/;\n var MONTH_REGEXP = /^(\\d{4,})-(\\d\\d)$/;\n var TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n var PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown';\n var PARTIAL_VALIDATION_TYPES = createMap();\n forEach('date,datetime-local,month,time,week'.split(','), function (type) {\n PARTIAL_VALIDATION_TYPES[type] = true;\n });\n var inputType = {\n /**\n * @ngdoc input\n * @name input[text]\n *\n * @description\n * Standard HTML text input with AngularJS data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Adds `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Single word only!\n
\n text = {{example.text}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var text = element(by.binding('example.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.text'));\n it('should initialize to model', function() {\n expect(text.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n it('should be invalid if multi word', function() {\n input.clear();\n input.sendKeys('hello world');\n expect(valid.getText()).toContain('false');\n });\n \n
\n */\n 'text': textInputType,\n /**\n * @ngdoc input\n * @name input[date]\n *\n * @description\n * Input with date validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n * modern browsers do not yet support this input type, it is important to provide cues to users on the\n * expected input format via a placeholder or label.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `min=\"{{minDate | date:'yyyy-MM-dd'}}\"`). Note that `min` will also add native HTML5\n * constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `max=\"{{maxDate | date:'yyyy-MM-dd'}}\"`). Note that `max` will also add native HTML5\n * constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-MM-dd\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (see https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10-22');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n it('should be invalid if over max', function() {\n setInput('2015-01-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
\n */\n 'date': createDateInputType('date', DATE_REGEXP, createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']), 'yyyy-MM-dd'),\n /**\n * @ngdoc input\n * @name input[datetime-local]\n *\n * @description\n * Input with datetime validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * The format of the displayed time can be adjusted with the\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`\n * and `timeStripZeroSeconds`.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `min=\"{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `min` will also add native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `max=\"{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `max` will also add native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2010-12-28T14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n it('should be invalid if over max', function() {\n setInput('2015-01-01T23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
\n */\n 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP, createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']), 'yyyy-MM-ddTHH:mm:ss.sss'),\n /**\n * @ngdoc input\n * @name input[time]\n *\n * @description\n * Input with time validation and transformation. In browsers that do not yet support\n * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions}. By default,\n * this is the timezone of the browser.\n *\n * The format of the displayed time can be adjusted with the\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`\n * and `timeStripZeroSeconds`.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minTime | date:'HH:mm:ss'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxTime | date:'HH:mm:ss'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the\n * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the\n * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"HH:mm:ss\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n it('should initialize to model', function() {\n expect(value.getText()).toContain('14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n it('should be invalid if over max', function() {\n setInput('23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
\n */\n 'time': createDateInputType('time', TIME_REGEXP, createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']), 'HH:mm:ss.sss'),\n /**\n * @ngdoc input\n * @name input[week]\n *\n * @description\n * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * week format (yyyy-W##), for example: `2013-W02`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The value of the resulting Date object will be set to Thursday at 00:00:00 of the requested week,\n * due to ISO-8601 week numbering standards. Information on ISO's system for numbering the weeks of the\n * year can be found at: https://en.wikipedia.org/wiki/ISO_8601#Week_dates\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minWeek | date:'yyyy-Www'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxWeek | date:'yyyy-Www'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not a valid date!\n
\n value = {{example.value | date: \"yyyy-Www\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-W01');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n it('should be invalid if over max', function() {\n setInput('2015-W01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
\n */\n 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n /**\n * @ngdoc input\n * @name input[month]\n *\n * @description\n * Input with month validation and transformation. In browsers that do not yet support\n * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * month format (yyyy-MM), for example: `2009-01`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n * If the model is not set to the first of the month, the next view to model update will set it\n * to the first of the month.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minMonth | date:'yyyy-MM'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxMonth | date:'yyyy-MM'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n \n
\n \n Required!\n \n Not a valid month!\n
\n value = {{example.value | date: \"yyyy-MM\"}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n it('should be invalid if over max', function() {\n setInput('2015-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
\n */\n 'month': createDateInputType('month', MONTH_REGEXP, createDateParser(MONTH_REGEXP, ['yyyy', 'MM']), 'yyyy-MM'),\n /**\n * @ngdoc input\n * @name input[number]\n *\n * @description\n * Text input with number validation and transformation. Sets the `number` validation\n * error if not a valid number.\n *\n *
\n * The model must always be of type `number` otherwise AngularJS will throw an error.\n * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}\n * error docs for more information and an example of how to convert your model if necessary.\n *
\n *\n *\n *\n * @knownIssue\n *\n * ### HTML5 constraint validation and `allowInvalid`\n *\n * In browsers that follow the\n * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),\n * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.\n * If a non-number is entered in the input, the browser will report the value as an empty string,\n * which means the view / model values in `ngModel` and subsequently the scope value\n * will also be an empty string.\n *\n * @knownIssue\n *\n * ### Large numbers and `step` validation\n *\n * The `step` validation will not work correctly for very large numbers (e.g. 9999999999) due to\n * Javascript's arithmetic limitations. If you need to handle large numbers, purpose-built\n * libraries (e.g. https://github.com/MikeMcl/big.js/), can be included into AngularJS by\n * {@link guide/forms#modifying-built-in-validators overwriting the validators}\n * for `number` and / or `step`, or by {@link guide/forms#custom-validation applying custom validators}\n * to an `input[text]` element. The source for `input[number]` type can be used as a starting\n * point for both implementations.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * Can be interpolated.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * Can be interpolated.\n * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint.\n * Can be interpolated.\n * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not valid number!\n
\n value = {{example.value}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n
\n
\n \n var value = element(by.binding('example.value'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n it('should initialize to model', function() {\n expect(value.getText()).toContain('12');\n expect(valid.getText()).toContain('true');\n });\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n it('should be invalid if over max', function() {\n input.clear();\n input.sendKeys('123');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n \n
\n */\n 'number': numberInputType,\n /**\n * @ngdoc input\n * @name input[url]\n *\n * @description\n * Text input with URL validation. Sets the `url` validation error key if the content is not a\n * valid URL.\n *\n *
\n * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n * the built-in validators (see the {@link guide/forms Forms guide})\n *
\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n
\n \n var text = element(by.binding('url.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('url.text'));\n it('should initialize to model', function() {\n expect(text.getText()).toContain('http://google.com');\n expect(valid.getText()).toContain('true');\n });\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n it('should be invalid if not url', function() {\n input.clear();\n input.sendKeys('box');\n expect(valid.getText()).toContain('false');\n });\n \n
\n */\n 'url': urlInputType,\n /**\n * @ngdoc input\n * @name input[email]\n *\n * @description\n * Text input with email validation. Sets the `email` validation error key if not a valid email\n * address.\n *\n *
\n * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n * used in Chromium, which may not fulfill your app's requirements.\n * If you need stricter (e.g. requiring a top-level domain), or more relaxed validation\n * (e.g. allowing IPv6 address literals) you can use `ng-pattern` or\n * modify the built-in validators (see the {@link guide/forms Forms guide}).\n *
\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n \n
\n \n Required!\n \n Not valid email!\n
\n text = {{email.text}}
\n myForm.input.$valid = {{myForm.input.$valid}}
\n myForm.input.$error = {{myForm.input.$error}}
\n myForm.$valid = {{myForm.$valid}}
\n myForm.$error.required = {{!!myForm.$error.required}}
\n myForm.$error.email = {{!!myForm.$error.email}}
\n
\n
\n \n var text = element(by.binding('email.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('email.text'));\n it('should initialize to model', function() {\n expect(text.getText()).toContain('me@example.com');\n expect(valid.getText()).toContain('true');\n });\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n it('should be invalid if not email', function() {\n input.clear();\n input.sendKeys('xxx');\n expect(valid.getText()).toContain('false');\n });\n \n
\n */\n 'email': emailInputType,\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * **Note:**
\n * All inputs controlled by {@link ngModel ngModel} (including those of type `radio`) will use the\n * value of their `name` attribute to determine the property under which their\n * {@link ngModel.NgModelController NgModelController} will be published on the parent\n * {@link form.FormController FormController}. Thus, if you use the same `name` for multiple\n * inputs of a form (e.g. a group of radio inputs), only _one_ `NgModelController` will be\n * published on the parent `FormController` under that name. The rest of the controllers will\n * continue to work as expected, but you won't be able to access them as properties on the parent\n * `FormController`.\n *\n *
\n *

\n * In plain HTML forms, the `name` attribute is used to identify groups of radio inputs, so\n * that the browser can manage their state (checked/unchecked) based on the state of other\n * inputs in the same group.\n *

\n *

\n * In AngularJS forms, this is not necessary. The input's state will be updated based on the\n * value of the underlying model data.\n *

\n *
\n *\n *
\n * If you omit the `name` attribute on a radio input, `ngModel` will automatically assign it a\n * unique name.\n *
\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string} value The value to which the `ngModel` expression should be set when selected.\n * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,\n * too. Use `ngValue` if you need complex models (`number`, `object`, ...).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue AngularJS expression to which `ngModel` will be be set when the radio\n * is selected. Should be used instead of the `value` attribute if you need\n * a non-string `ngModel` (`boolean`, `array`, ...).\n *\n * @example\n \n \n \n
\n
\n
\n
\n color = {{color.name | json}}
\n
\n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n
\n \n it('should change state', function() {\n var inputs = element.all(by.model('color.name'));\n var color = element(by.binding('color.name'));\n expect(color.getText()).toContain('blue');\n inputs.get(0).click();\n expect(color.getText()).toContain('red');\n inputs.get(1).click();\n expect(color.getText()).toContain('green');\n });\n \n
\n */\n 'radio': radioInputType,\n /**\n * @ngdoc input\n * @name input[range]\n *\n * @description\n * Native range input with validation and transformation.\n *\n * The model for the range input must always be a `Number`.\n *\n * IE9 and other browsers that do not support the `range` type fall back\n * to a text input without any default values for `min`, `max` and `step`. Model binding,\n * validation and number parsing are nevertheless supported.\n *\n * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]`\n * in a way that never allows the input to hold an invalid value. That means:\n * - any non-numerical value is set to `(max + min) / 2`.\n * - any numerical value that is less than the current min val, or greater than the current max val\n * is set to the min / max val respectively.\n * - additionally, the current `step` is respected, so the nearest value that satisfies a step\n * is used.\n *\n * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range))\n * for more info.\n *\n * This has the following consequences for AngularJS:\n *\n * Since the element value should always reflect the current model value, a range input\n * will set the bound ngModel expression to the value that the browser has set for the\n * input element. For example, in the following input ``,\n * if the application sets `model.value = null`, the browser will set the input to `'50'`.\n * AngularJS will then set the model to `50`, to prevent input and model value being out of sync.\n *\n * That means the model for range will immediately be set to `50` after `ngModel` has been\n * initialized. It also means a range input can never have the required error.\n *\n * This does not only affect changes to the model value, but also to the values of the `min`,\n * `max`, and `step` attributes. When these change in a way that will cause the browser to modify\n * the input value, AngularJS will also update the model value.\n *\n * Automatic value adjustment also means that a range input element can never have the `required`,\n * `min`, or `max` errors.\n *\n * However, `step` is currently only fully implemented by Firefox. Other browsers have problems\n * when the step value changes dynamically - they do not adjust the element value correctly, but\n * instead may set the `stepMismatch` error. If that's the case, the AngularJS will set the `step`\n * error on the input, and set the model to `undefined`.\n *\n * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do\n * not set the `min` and `max` attributes, which means that the browser won't automatically adjust\n * the input value based on their values, and will always assume min = 0, max = 100, and step = 1.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation to ensure that the value entered is greater\n * than `min`. Can be interpolated.\n * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`.\n * Can be interpolated.\n * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step`\n * Can be interpolated.\n * @param {expression=} ngChange AngularJS expression to be executed when the ngModel value changes due\n * to user interaction with the input element.\n * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the\n * element. **Note** : `ngChecked` should not be used alongside `ngModel`.\n * Checkout {@link ng.directive:ngChecked ngChecked} for usage.\n *\n * @example\n \n \n \n
\n Model as range: \n
\n Model as number:
\n Min:
\n Max:
\n value = {{value}}
\n myForm.range.$valid = {{myForm.range.$valid}}
\n myForm.range.$error = {{myForm.range.$error}}\n
\n
\n
\n * ## Range Input with ngMin & ngMax attributes\n * @example\n \n \n \n
\n Model as range: \n
\n Model as number:
\n Min:
\n Max:
\n value = {{value}}
\n myForm.range.$valid = {{myForm.range.$valid}}
\n myForm.range.$error = {{myForm.range.$error}}\n
\n
\n
\n */\n 'range': rangeInputType,\n /**\n * @ngdoc input\n * @name input[checkbox]\n *\n * @description\n * HTML checkbox.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ngTrueValue The value to which the expression should be set when selected.\n * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
\n
\n
\n value1 = {{checkboxModel.value1}}
\n value2 = {{checkboxModel.value2}}
\n
\n
\n \n it('should change state', function() {\n var value1 = element(by.binding('checkboxModel.value1'));\n var value2 = element(by.binding('checkboxModel.value2'));\n expect(value1.getText()).toContain('true');\n expect(value2.getText()).toContain('YES');\n element(by.model('checkboxModel.value1')).click();\n element(by.model('checkboxModel.value2')).click();\n expect(value1.getText()).toContain('false');\n expect(value2.getText()).toContain('NO');\n });\n \n
\n */\n 'checkbox': checkboxInputType,\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop,\n 'file': noop\n };\n function stringBasedInputType(ctrl) {\n ctrl.$formatters.push(function (value) {\n return ctrl.$isEmpty(value) ? value : value.toString();\n });\n }\n function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n }\n function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n var type = lowercase(element[0].type);\n\n // In composition mode, users are still inputting intermediate text buffer,\n // hold the listener until composition is done.\n // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n if (!$sniffer.android) {\n var composing = false;\n element.on('compositionstart', function () {\n composing = true;\n });\n\n // Support: IE9+\n element.on('compositionupdate', function (ev) {\n // End composition when ev.data is empty string on 'compositionupdate' event.\n // When the input de-focusses (e.g. by clicking away), IE triggers 'compositionupdate'\n // instead of 'compositionend'.\n if (isUndefined(ev.data) || ev.data === '') {\n composing = false;\n }\n });\n element.on('compositionend', function () {\n composing = false;\n listener();\n });\n }\n var timeout;\n var listener = function (ev) {\n if (timeout) {\n $browser.defer.cancel(timeout);\n timeout = null;\n }\n if (composing) return;\n var value = element.val(),\n event = ev && ev.type;\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // If input type is 'password', the value is never trimmed\n if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n value = trim(value);\n }\n\n // If a control is suffering from bad input (due to native validators), browsers discard its\n // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n // control's value is the same empty value twice in a row.\n if (ctrl.$viewValue !== value || value === '' && ctrl.$$hasNativeValidators) {\n ctrl.$setViewValue(value, event);\n }\n };\n\n // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n // input event on backspace, delete or cut\n if ($sniffer.hasEvent('input')) {\n element.on('input', listener);\n } else {\n var deferListener = function (ev, input, origValue) {\n if (!timeout) {\n timeout = $browser.defer(function () {\n timeout = null;\n if (!input || input.value !== origValue) {\n listener(ev);\n }\n });\n }\n };\n element.on('keydown', /** @this */function (event) {\n var key = event.keyCode;\n\n // ignore\n // command modifiers arrows\n if (key === 91 || 15 < key && key < 19 || 37 <= key && key <= 40) return;\n deferListener(event, this, this.value);\n });\n\n // if user modifies input value using context menu in IE, we need \"paste\", \"cut\" and \"drop\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut drop', deferListener);\n }\n }\n\n // if user paste into input using mouse on older browser\n // or form autocomplete on newer browser, we need \"change\" event to catch it\n element.on('change', listener);\n\n // Some native input types (date-family) have the ability to change validity without\n // firing any input/change events.\n // For these event types, when native validators are present and the browser supports the type,\n // check for validity changes on various DOM events.\n if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {\n element.on(PARTIAL_VALIDATION_EVENTS, /** @this */function (ev) {\n if (!timeout) {\n var validity = this[VALIDITY_STATE_PROPERTY];\n var origBadInput = validity.badInput;\n var origTypeMismatch = validity.typeMismatch;\n timeout = $browser.defer(function () {\n timeout = null;\n if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) {\n listener(ev);\n }\n });\n }\n });\n }\n ctrl.$render = function () {\n // Workaround for Firefox validation #12102.\n var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;\n if (element.val() !== value) {\n element.val(value);\n }\n };\n }\n function weekParser(isoWeek, existingDate) {\n if (isDate(isoWeek)) {\n return isoWeek;\n }\n if (isString(isoWeek)) {\n WEEK_REGEXP.lastIndex = 0;\n var parts = WEEK_REGEXP.exec(isoWeek);\n if (parts) {\n var year = +parts[1],\n week = +parts[2],\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n firstThurs = getFirstThursdayOfYear(year),\n addDays = (week - 1) * 7;\n if (existingDate) {\n hours = existingDate.getHours();\n minutes = existingDate.getMinutes();\n seconds = existingDate.getSeconds();\n milliseconds = existingDate.getMilliseconds();\n }\n return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n }\n }\n return NaN;\n }\n function createDateParser(regexp, mapping) {\n return function (iso, previousDate) {\n var parts, map;\n if (isDate(iso)) {\n return iso;\n }\n if (isString(iso)) {\n // When a date is JSON'ified to wraps itself inside of an extra\n // set of double quotes. This makes the date parsing code unable\n // to match the date string and parse it as a date.\n if (iso.charAt(0) === '\"' && iso.charAt(iso.length - 1) === '\"') {\n iso = iso.substring(1, iso.length - 1);\n }\n if (ISO_DATE_REGEXP.test(iso)) {\n return new Date(iso);\n }\n regexp.lastIndex = 0;\n parts = regexp.exec(iso);\n if (parts) {\n parts.shift();\n if (previousDate) {\n map = {\n yyyy: previousDate.getFullYear(),\n MM: previousDate.getMonth() + 1,\n dd: previousDate.getDate(),\n HH: previousDate.getHours(),\n mm: previousDate.getMinutes(),\n ss: previousDate.getSeconds(),\n sss: previousDate.getMilliseconds() / 1000\n };\n } else {\n map = {\n yyyy: 1970,\n MM: 1,\n dd: 1,\n HH: 0,\n mm: 0,\n ss: 0,\n sss: 0\n };\n }\n forEach(parts, function (part, index) {\n if (index < mapping.length) {\n map[mapping[index]] = +part;\n }\n });\n var date = new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n if (map.yyyy < 100) {\n // In the constructor, 2-digit years map to 1900-1999.\n // Use `setFullYear()` to set the correct year.\n date.setFullYear(map.yyyy);\n }\n return date;\n }\n }\n return NaN;\n };\n }\n function createDateInputType(type, regexp, parseDate, format) {\n return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n badInputChecker(scope, element, attr, ctrl, type);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var isTimeType = type === 'time' || type === 'datetimelocal';\n var previousDate;\n var previousTimezone;\n ctrl.$parsers.push(function (value) {\n if (ctrl.$isEmpty(value)) return null;\n if (regexp.test(value)) {\n // Note: We cannot read ctrl.$modelValue, as there might be a different\n // parser/formatter in the processing chain so that the model\n // contains some different data format!\n return parseDateAndConvertTimeZoneToLocal(value, previousDate);\n }\n ctrl.$$parserName = type;\n return undefined;\n });\n ctrl.$formatters.push(function (value) {\n if (value && !isDate(value)) {\n throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n }\n if (isValidDate(value)) {\n previousDate = value;\n var timezone = ctrl.$options.getOption('timezone');\n if (timezone) {\n previousTimezone = timezone;\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n return formatter(value, timezone);\n } else {\n previousDate = null;\n previousTimezone = null;\n return '';\n }\n });\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal = attr.min || $parse(attr.ngMin)(scope);\n var parsedMinVal = parseObservedDateValue(minVal);\n ctrl.$validators.min = function (value) {\n return !isValidDate(value) || isUndefined(parsedMinVal) || parseDate(value) >= parsedMinVal;\n };\n attr.$observe('min', function (val) {\n if (val !== minVal) {\n parsedMinVal = parseObservedDateValue(val);\n minVal = val;\n ctrl.$validate();\n }\n });\n }\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal = attr.max || $parse(attr.ngMax)(scope);\n var parsedMaxVal = parseObservedDateValue(maxVal);\n ctrl.$validators.max = function (value) {\n return !isValidDate(value) || isUndefined(parsedMaxVal) || parseDate(value) <= parsedMaxVal;\n };\n attr.$observe('max', function (val) {\n if (val !== maxVal) {\n parsedMaxVal = parseObservedDateValue(val);\n maxVal = val;\n ctrl.$validate();\n }\n });\n }\n function isValidDate(value) {\n // Invalid Date: getTime() returns NaN\n return value && !(value.getTime && value.getTime() !== value.getTime());\n }\n function parseObservedDateValue(val) {\n return isDefined(val) && !isDate(val) ? parseDateAndConvertTimeZoneToLocal(val) || undefined : val;\n }\n function parseDateAndConvertTimeZoneToLocal(value, previousDate) {\n var timezone = ctrl.$options.getOption('timezone');\n if (previousTimezone && previousTimezone !== timezone) {\n // If the timezone has changed, adjust the previousDate to the default timezone\n // so that the new date is converted with the correct timezone offset\n previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));\n }\n var parsedDate = parseDate(value, previousDate);\n if (!isNaN(parsedDate) && timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\n }\n function formatter(value, timezone) {\n var targetFormat = format;\n if (isTimeType && isString(ctrl.$options.getOption('timeSecondsFormat'))) {\n targetFormat = format.replace('ss.sss', ctrl.$options.getOption('timeSecondsFormat')).replace(/:$/, '');\n }\n var formatted = $filter('date')(value, targetFormat, timezone);\n if (isTimeType && ctrl.$options.getOption('timeStripZeroSeconds')) {\n formatted = formatted.replace(/(?::00)?(?:\\.000)?$/, '');\n }\n return formatted;\n }\n };\n }\n function badInputChecker(scope, element, attr, ctrl, parserName) {\n var node = element[0];\n var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n if (nativeValidation) {\n ctrl.$parsers.push(function (value) {\n var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n if (validity.badInput || validity.typeMismatch) {\n ctrl.$$parserName = parserName;\n return undefined;\n }\n return value;\n });\n }\n }\n function numberFormatterParser(ctrl) {\n ctrl.$parsers.push(function (value) {\n if (ctrl.$isEmpty(value)) return null;\n if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n ctrl.$$parserName = 'number';\n return undefined;\n });\n ctrl.$formatters.push(function (value) {\n if (!ctrl.$isEmpty(value)) {\n if (!isNumber(value)) {\n throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n }\n value = value.toString();\n }\n return value;\n });\n }\n function parseNumberAttrVal(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val);\n }\n return !isNumberNaN(val) ? val : undefined;\n }\n function isNumberInteger(num) {\n // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066\n // (minus the assumption that `num` is a number)\n\n // eslint-disable-next-line no-bitwise\n return (num | 0) === num;\n }\n function countDecimals(num) {\n var numString = num.toString();\n var decimalSymbolIndex = numString.indexOf('.');\n if (decimalSymbolIndex === -1) {\n if (-1 < num && num < 1) {\n // It may be in the exponential notation format (`1e-X`)\n var match = /e-(\\d+)$/.exec(numString);\n if (match) {\n return Number(match[1]);\n }\n }\n return 0;\n }\n return numString.length - decimalSymbolIndex - 1;\n }\n function isValidForStep(viewValue, stepBase, step) {\n // At this point `stepBase` and `step` are expected to be non-NaN values\n // and `viewValue` is expected to be a valid stringified number.\n var value = Number(viewValue);\n var isNonIntegerValue = !isNumberInteger(value);\n var isNonIntegerStepBase = !isNumberInteger(stepBase);\n var isNonIntegerStep = !isNumberInteger(step);\n\n // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or\n // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers.\n if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) {\n var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0;\n var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0;\n var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0;\n var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals);\n var multiplier = Math.pow(10, decimalCount);\n value = value * multiplier;\n stepBase = stepBase * multiplier;\n step = step * multiplier;\n if (isNonIntegerValue) value = Math.round(value);\n if (isNonIntegerStepBase) stepBase = Math.round(stepBase);\n if (isNonIntegerStep) step = Math.round(step);\n }\n return (value - stepBase) % step === 0;\n }\n function numberInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n badInputChecker(scope, element, attr, ctrl, 'number');\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var parsedMinVal;\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal = attr.min || $parse(attr.ngMin)(scope);\n parsedMinVal = parseNumberAttrVal(minVal);\n ctrl.$validators.min = function (modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedMinVal) || viewValue >= parsedMinVal;\n };\n attr.$observe('min', function (val) {\n if (val !== minVal) {\n parsedMinVal = parseNumberAttrVal(val);\n minVal = val;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n });\n }\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal = attr.max || $parse(attr.ngMax)(scope);\n var parsedMaxVal = parseNumberAttrVal(maxVal);\n ctrl.$validators.max = function (modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedMaxVal) || viewValue <= parsedMaxVal;\n };\n attr.$observe('max', function (val) {\n if (val !== maxVal) {\n parsedMaxVal = parseNumberAttrVal(val);\n maxVal = val;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n });\n }\n if (isDefined(attr.step) || attr.ngStep) {\n var stepVal = attr.step || $parse(attr.ngStep)(scope);\n var parsedStepVal = parseNumberAttrVal(stepVal);\n ctrl.$validators.step = function (modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedStepVal) || isValidForStep(viewValue, parsedMinVal || 0, parsedStepVal);\n };\n attr.$observe('step', function (val) {\n // TODO(matsko): implement validateLater to reduce number of validations\n if (val !== stepVal) {\n parsedStepVal = parseNumberAttrVal(val);\n stepVal = val;\n ctrl.$validate();\n }\n });\n }\n }\n function rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl, 'range');\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range',\n minVal = supportsRange ? 0 : undefined,\n maxVal = supportsRange ? 100 : undefined,\n stepVal = supportsRange ? 1 : undefined,\n validity = element[0].validity,\n hasMinAttr = isDefined(attr.min),\n hasMaxAttr = isDefined(attr.max),\n hasStepAttr = isDefined(attr.step);\n var originalRender = ctrl.$render;\n ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ?\n //Browsers that implement range will set these values automatically, but reading the adjusted values after\n //$render would cause the min / max validators to be applied with the wrong value\n function rangeRender() {\n originalRender();\n ctrl.$setViewValue(element.val());\n } : originalRender;\n if (hasMinAttr) {\n minVal = parseNumberAttrVal(attr.min);\n ctrl.$validators.min = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMinValidator() {\n return true;\n } :\n // non-support browsers validate the min val\n function minValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal;\n };\n setInitialValueAndObserver('min', minChange);\n }\n if (hasMaxAttr) {\n maxVal = parseNumberAttrVal(attr.max);\n ctrl.$validators.max = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMaxValidator() {\n return true;\n } :\n // non-support browsers validate the max val\n function maxValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal;\n };\n setInitialValueAndObserver('max', maxChange);\n }\n if (hasStepAttr) {\n stepVal = parseNumberAttrVal(attr.step);\n ctrl.$validators.step = supportsRange ? function nativeStepValidator() {\n // Currently, only FF implements the spec on step change correctly (i.e. adjusting the\n // input element value to a valid value). It's possible that other browsers set the stepMismatch\n // validity error instead, so we can at least report an error in that case.\n return !validity.stepMismatch;\n } :\n // ngStep doesn't set the setp attr, so the browser doesn't adjust the input value as setting step would\n function stepValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) || isValidForStep(viewValue, minVal || 0, stepVal);\n };\n setInitialValueAndObserver('step', stepChange);\n }\n function setInitialValueAndObserver(htmlAttrName, changeFn) {\n // interpolated attributes set the attribute value only after a digest, but we need the\n // attribute value when the input is first rendered, so that the browser can adjust the\n // input value based on the min/max value\n element.attr(htmlAttrName, attr[htmlAttrName]);\n var oldVal = attr[htmlAttrName];\n attr.$observe(htmlAttrName, function wrappedObserver(val) {\n if (val !== oldVal) {\n oldVal = val;\n changeFn(val);\n }\n });\n }\n function minChange(val) {\n minVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the minVal is greater than the element value\n if (minVal > elVal) {\n elVal = minVal;\n element.val(elVal);\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n function maxChange(val) {\n maxVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the maxVal is less than the element value\n if (maxVal < elVal) {\n element.val(maxVal);\n // IE11 and Chrome don't set the value to the minVal when max < min\n elVal = maxVal < minVal ? minVal : maxVal;\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n function stepChange(val) {\n stepVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n // Some browsers don't adjust the input value correctly, but set the stepMismatch error\n if (!supportsRange) {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n } else if (ctrl.$viewValue !== element.val()) {\n ctrl.$setViewValue(element.val());\n }\n }\n }\n function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n ctrl.$validators.url = function (modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n };\n }\n function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n ctrl.$validators.email = function (modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n };\n }\n function radioInputType(scope, element, attr, ctrl) {\n var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false';\n // make the name unique, if not defined\n if (isUndefined(attr.name)) {\n element.attr('name', nextUid());\n }\n var listener = function (ev) {\n var value;\n if (element[0].checked) {\n value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n ctrl.$setViewValue(value, ev && ev.type);\n }\n };\n element.on('change', listener);\n ctrl.$render = function () {\n var value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n element[0].checked = value === ctrl.$viewValue;\n };\n attr.$observe('value', ctrl.$render);\n }\n function parseConstantExpr($parse, context, name, expression, fallback) {\n var parseFn;\n if (isDefined(expression)) {\n parseFn = $parse(expression);\n if (!parseFn.constant) {\n throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' + '`{1}`.', name, expression);\n }\n return parseFn(context);\n }\n return fallback;\n }\n function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n var listener = function (ev) {\n ctrl.$setViewValue(element[0].checked, ev && ev.type);\n };\n element.on('change', listener);\n ctrl.$render = function () {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n // it to a boolean.\n ctrl.$isEmpty = function (value) {\n return value === false;\n };\n ctrl.$formatters.push(function (value) {\n return equals(value, trueValue);\n });\n ctrl.$parsers.push(function (value) {\n return value ? trueValue : falseValue;\n });\n }\n\n /**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with AngularJS data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
\n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.\n *\n * @knownIssue\n *\n * When specifying the `placeholder` attribute of `\n *
{{ list | json }}
\n * \n * \n * it(\"should split the text by newlines\", function() {\n * var listInput = element(by.model('list'));\n * var output = element(by.binding('list | json'));\n * listInput.sendKeys('abc\\ndef\\nghi');\n * expect(output.getText()).toContain('[\\n \"abc\",\\n \"def\",\\n \"ghi\"\\n]');\n * });\n * \n * \n *\n */\n var ngListDirective = function () {\n return {\n restrict: 'A',\n priority: 100,\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n var ngList = attr.ngList || ', ';\n var trimValues = attr.ngTrim !== 'false';\n var separator = trimValues ? trim(ngList) : ngList;\n var parse = function (viewValue) {\n // If the viewValue is invalid (say required but empty) it will be `undefined`\n if (isUndefined(viewValue)) return;\n var list = [];\n if (viewValue) {\n forEach(viewValue.split(separator), function (value) {\n if (value) list.push(trimValues ? trim(value) : value);\n });\n }\n return list;\n };\n ctrl.$parsers.push(parse);\n ctrl.$formatters.push(function (value) {\n if (isArray(value)) {\n return value.join(ngList);\n }\n return undefined;\n });\n\n // Override the standard $isEmpty because an empty array means the input is empty.\n ctrl.$isEmpty = function (value) {\n return !value || !value.length;\n };\n }\n };\n };\n\n /* global VALID_CLASS: true,\n INVALID_CLASS: true,\n PRISTINE_CLASS: true,\n DIRTY_CLASS: true,\n UNTOUCHED_CLASS: true,\n TOUCHED_CLASS: true,\n PENDING_CLASS: true,\n addSetValidityMethod: true,\n setupValidity: true,\n defaultModelOptions: false\n */\n\n var VALID_CLASS = 'ng-valid',\n INVALID_CLASS = 'ng-invalid',\n PRISTINE_CLASS = 'ng-pristine',\n DIRTY_CLASS = 'ng-dirty',\n UNTOUCHED_CLASS = 'ng-untouched',\n TOUCHED_CLASS = 'ng-touched',\n EMPTY_CLASS = 'ng-empty',\n NOT_EMPTY_CLASS = 'ng-not-empty';\n var ngModelMinErr = minErr('ngModel');\n\n /**\n * @ngdoc type\n * @name ngModel.NgModelController\n * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a\n * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue\n * is set.\n *\n * @property {*} $modelValue The value in the model that the control is bound to.\n *\n * @property {Array.} $parsers Array of functions to execute, as a pipeline, whenever\n * the control updates the ngModelController with a new {@link ngModel.NgModelController#$viewValue\n `$viewValue`} from the DOM, usually via user input.\n See {@link ngModel.NgModelController#$setViewValue `$setViewValue()`} for a detailed lifecycle explanation.\n Note that the `$parsers` are not called when the bound ngModel expression changes programmatically.\n \n The functions are called in array order, each passing\n its return value through to the next. The last return value is forwarded to the\n {@link ngModel.NgModelController#$validators `$validators`} collection.\n \n Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n `$viewValue`}.\n \n Returning `undefined` from a parser means a parse error occurred. In that case,\n no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\n will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\n is set to `true`. The parse error is stored in `ngModel.$error.parse`.\n \n This simple example shows a parser that would convert text input value to lowercase:\n * ```js\n * function parse(value) {\n * if (value) {\n * return value.toLowerCase();\n * }\n * }\n * ngModelController.$parsers.push(parse);\n * ```\n \n *\n * @property {Array.} $formatters Array of functions to execute, as a pipeline, whenever\n the bound ngModel expression changes programmatically. The `$formatters` are not called when the\n value of the control is changed by user interaction.\n \n Formatters are used to format / convert the {@link ngModel.NgModelController#$modelValue\n `$modelValue`} for display in the control.\n \n The functions are called in reverse array order, each passing the value through to the\n next. The last return value is used as the actual DOM value.\n \n This simple example shows a formatter that would convert the model value to uppercase:\n \n * ```js\n * function format(value) {\n * if (value) {\n * return value.toUpperCase();\n * }\n * }\n * ngModel.$formatters.push(format);\n * ```\n *\n * @property {Object.} $validators A collection of validators that are applied\n * whenever the model value changes. The key value within the object refers to the name of the\n * validator while the function refers to the validation operation. The validation operation is\n * provided with the model value as an argument and must return a true or false value depending\n * on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n * return /[0-9]+/.test(value) &&\n * /[a-z]+/.test(value) &&\n * /[A-Z]+/.test(value) &&\n * /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.} $asyncValidators A collection of validations that are expected to\n * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n * is expected to return a promise when it is run during the model validation process. Once the promise\n * is delivered then the validation status will be set to true when fulfilled and false when rejected.\n * When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n * will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n *\n * // Lookup user by username\n * return $http.get('/api/users/' + value).\n * then(function resolved() {\n * //username exists, this means validation fails\n * return $q.reject('exists');\n * }, function rejected() {\n * //username does not exist, therefore this validation passes\n * return true;\n * });\n * };\n * ```\n *\n * @property {Array.} $viewChangeListeners Array of functions to execute whenever\n * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change\n * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.\n * It is called with no arguments, and its return value is ignored.\n * This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * AngularJS provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. ``).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * \n \n [contenteditable] {\n border: 1px solid black;\n background-color: white;\n min-height: 20px;\n }\n \n .ng-invalid {\n border: 1px solid red;\n }\n \n \n \n angular.module('customControl', ['ngSanitize']).\n directive('contenteditable', ['$sce', function($sce) {\n return {\n restrict: 'A', // only activate on element attribute\n require: '?ngModel', // get a hold of NgModelController\n link: function(scope, element, attrs, ngModel) {\n if (!ngModel) return; // do nothing if no ng-model\n \n // Specify how UI should be updated\n ngModel.$render = function() {\n element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n };\n \n // Listen for change events to enable binding\n element.on('blur keyup change', function() {\n scope.$evalAsync(read);\n });\n read(); // initialize\n \n // Write data to the model\n function read() {\n var html = element.html();\n // When we clear the content editable the browser leaves a
behind\n // If strip-br attribute is provided then we strip this out\n if (attrs.stripBr && html === '
') {\n html = '';\n }\n ngModel.$setViewValue(html);\n }\n }\n };\n }]);\n
\n \n
\n
Change me!
\n Required!\n
\n \n
\n
\n \n it('should data-bind and become invalid', function() {\n if (browser.params.browser === 'safari' || browser.params.browser === 'firefox') {\n // SafariDriver can't handle contenteditable\n // and Firefox driver can't clear contenteditables very well\n return;\n }\n var contentEditable = element(by.css('[contenteditable]'));\n var content = 'Change me!';\n \n expect(contentEditable.getText()).toEqual(content);\n \n contentEditable.clear();\n contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n expect(contentEditable.getText()).toEqual('');\n expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n });\n \n *
\n *\n *\n */\n NgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];\n function NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {\n this.$viewValue = Number.NaN;\n this.$modelValue = Number.NaN;\n this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n this.$validators = {};\n this.$asyncValidators = {};\n this.$parsers = [];\n this.$formatters = [];\n this.$viewChangeListeners = [];\n this.$untouched = true;\n this.$touched = false;\n this.$pristine = true;\n this.$dirty = false;\n this.$valid = true;\n this.$invalid = false;\n this.$error = {}; // keep invalid keys here\n this.$$success = {}; // keep valid keys here\n this.$pending = undefined; // keep pending keys here\n this.$name = $interpolate($attr.name || '', false)($scope);\n this.$$parentForm = nullFormCtrl;\n this.$options = defaultModelOptions;\n this.$$updateEvents = '';\n // Attach the correct context to the event handler function for updateOn\n this.$$updateEventHandler = this.$$updateEventHandler.bind(this);\n this.$$parsedNgModel = $parse($attr.ngModel);\n this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;\n this.$$ngModelGet = this.$$parsedNgModel;\n this.$$ngModelSet = this.$$parsedNgModelAssign;\n this.$$pendingDebounce = null;\n this.$$parserValid = undefined;\n this.$$parserName = 'parse';\n this.$$currentValidationRunId = 0;\n this.$$scope = $scope;\n this.$$rootScope = $scope.$root;\n this.$$attr = $attr;\n this.$$element = $element;\n this.$$animate = $animate;\n this.$$timeout = $timeout;\n this.$$parse = $parse;\n this.$$q = $q;\n this.$$exceptionHandler = $exceptionHandler;\n setupValidity(this);\n setupModelWatcher(this);\n }\n NgModelController.prototype = {\n $$initGetterSetters: function () {\n if (this.$options.getOption('getterSetter')) {\n var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'),\n invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)');\n this.$$ngModelGet = function ($scope) {\n var modelValue = this.$$parsedNgModel($scope);\n if (isFunction(modelValue)) {\n modelValue = invokeModelGetter($scope);\n }\n return modelValue;\n };\n this.$$ngModelSet = function ($scope, newValue) {\n if (isFunction(this.$$parsedNgModel($scope))) {\n invokeModelSetter($scope, {\n $$$p: newValue\n });\n } else {\n this.$$parsedNgModelAssign($scope, newValue);\n }\n };\n } else if (!this.$$parsedNgModel.assign) {\n throw ngModelMinErr('nonassign', 'Expression \\'{0}\\' is non-assignable. Element: {1}', this.$$attr.ngModel, startingTag(this.$$element));\n }\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$render\n *\n * @description\n * Called when the view needs to be updated. It is expected that the user of the ng-model\n * directive will implement this method.\n *\n * The `$render()` method is invoked in the following situations:\n *\n * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last\n * committed value then `$render()` is called to update the input control.\n * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n * the `$viewValue` are different from last time.\n *\n * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`\n * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n * invoked if you only change a property on the objects.\n */\n $render: noop,\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$isEmpty\n *\n * @description\n * This is called when we need to determine if the value of an input is empty.\n *\n * For instance, the required directive does this to work out if the input has data or not.\n *\n * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n *\n * You can override this for input directives whose concept of being empty is different from the\n * default. The `checkboxInputType` directive does this because in its case a value of `false`\n * implies empty.\n *\n * @param {*} value The value of the input to check for emptiness.\n * @returns {boolean} True if `value` is \"empty\".\n */\n $isEmpty: function (value) {\n // eslint-disable-next-line no-self-compare\n return isUndefined(value) || value === '' || value === null || value !== value;\n },\n $$updateEmptyClasses: function (value) {\n if (this.$isEmpty(value)) {\n this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, EMPTY_CLASS);\n } else {\n this.$$animate.removeClass(this.$$element, EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS);\n }\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setPristine\n *\n * @description\n * Sets the control to its pristine state.\n *\n * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n * state (`ng-pristine` class). A model is considered to be pristine when the control\n * has not been changed from when first compiled.\n */\n $setPristine: function () {\n this.$dirty = false;\n this.$pristine = true;\n this.$$animate.removeClass(this.$$element, DIRTY_CLASS);\n this.$$animate.addClass(this.$$element, PRISTINE_CLASS);\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setDirty\n *\n * @description\n * Sets the control to its dirty state.\n *\n * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n * from when first compiled.\n */\n $setDirty: function () {\n this.$dirty = true;\n this.$pristine = false;\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$$parentForm.$setDirty();\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setUntouched\n *\n * @description\n * Sets the control to its untouched state.\n *\n * This method can be called to remove the `ng-touched` class and set the control to its\n * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n * by default, however this function can be used to restore that state if the model has\n * already been touched by the user.\n */\n $setUntouched: function () {\n this.$touched = false;\n this.$untouched = true;\n this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setTouched\n *\n * @description\n * Sets the control to its touched state.\n *\n * This method can be called to remove the `ng-untouched` class and set the control to its\n * touched state (`ng-touched` class). A model is considered to be touched when the user has\n * first focused the control element and then shifted focus away from the control (blur event).\n */\n $setTouched: function () {\n this.$touched = true;\n this.$untouched = false;\n this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$rollbackViewValue\n *\n * @description\n * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n * which may be caused by a pending debounced event or because the input is waiting for some\n * future event.\n *\n * If you have an input that uses `ng-model-options` to set up debounced updates or updates that\n * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of\n * sync with the ngModel's `$modelValue`.\n *\n * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update\n * and reset the input to the last committed view value.\n *\n * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue`\n * programmatically before these debounced/future events have resolved/occurred, because AngularJS's\n * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n *\n * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n * input which may have such events pending. This is important in order to make sure that the\n * input field will be updated with the new model value and any pending operations are cancelled.\n *\n * @example\n * \n * \n * angular.module('cancel-update-example', [])\n *\n * .controller('CancelUpdateController', ['$scope', function($scope) {\n * $scope.model = {value1: '', value2: ''};\n *\n * $scope.setEmpty = function(e, value, rollback) {\n * if (e.keyCode === 27) {\n * e.preventDefault();\n * if (rollback) {\n * $scope.myForm[value].$rollbackViewValue();\n * }\n * $scope.model[value] = '';\n * }\n * };\n * }]);\n * \n * \n *
\n *

Both of these inputs are only updated if they are blurred. Hitting escape should\n * empty them. Follow these steps and observe the difference:

\n *
    \n *
  1. Type something in the input. You will see that the model is not yet updated
  2. \n *
  3. Press the Escape key.\n *
      \n *
    1. In the first example, nothing happens, because the model is already '', and no\n * update is detected. If you blur the input, the model will be set to the current view.\n *
    2. \n *
    3. In the second example, the pending update is cancelled, and the input is set back\n * to the last committed view value (''). Blurring the input does nothing.\n *
    4. \n *
    \n *
  4. \n *
\n *\n *
\n *
\n *

Without $rollbackViewValue():

\n * \n * value1: \"{{ model.value1 }}\"\n *
\n *\n *
\n *

With $rollbackViewValue():

\n * \n * value2: \"{{ model.value2 }}\"\n *
\n *
\n *
\n *
\n \n div {\n display: table-cell;\n }\n div:nth-child(1) {\n padding-right: 30px;\n }\n \n *
\n */\n $rollbackViewValue: function () {\n this.$$timeout.cancel(this.$$pendingDebounce);\n this.$viewValue = this.$$lastCommittedViewValue;\n this.$render();\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$validate\n *\n * @description\n * Runs each of the registered validators (first synchronous validators and then\n * asynchronous validators).\n * If the validity changes to invalid, the model will be set to `undefined`,\n * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n * If the validity changes to valid, it will set the model to the last available valid\n * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.\n */\n $validate: function () {\n // ignore $validate before model is initialized\n if (isNumberNaN(this.$modelValue)) {\n return;\n }\n var viewValue = this.$$lastCommittedViewValue;\n // Note: we use the $$rawModelValue as $modelValue might have been\n // set to undefined during a view -> model update that found validation\n // errors. We can't parse the view here, since that could change\n // the model although neither viewValue nor the model on the scope changed\n var modelValue = this.$$rawModelValue;\n var prevValid = this.$valid;\n var prevModelValue = this.$modelValue;\n var allowInvalid = this.$options.getOption('allowInvalid');\n var that = this;\n this.$$runValidators(modelValue, viewValue, function (allValid) {\n // If there was no change in validity, don't update the model\n // This prevents changing an invalid modelValue to undefined\n if (!allowInvalid && prevValid !== allValid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n });\n },\n $$runValidators: function (modelValue, viewValue, doneCallback) {\n this.$$currentValidationRunId++;\n var localValidationRunId = this.$$currentValidationRunId;\n var that = this;\n\n // check parser error\n if (!processParseErrors()) {\n validationDone(false);\n return;\n }\n if (!processSyncValidators()) {\n validationDone(false);\n return;\n }\n processAsyncValidators();\n function processParseErrors() {\n var errorKey = that.$$parserName;\n if (isUndefined(that.$$parserValid)) {\n setValidity(errorKey, null);\n } else {\n if (!that.$$parserValid) {\n forEach(that.$validators, function (v, name) {\n setValidity(name, null);\n });\n forEach(that.$asyncValidators, function (v, name) {\n setValidity(name, null);\n });\n }\n\n // Set the parse error last, to prevent unsetting it, should a $validators key == parserName\n setValidity(errorKey, that.$$parserValid);\n return that.$$parserValid;\n }\n return true;\n }\n function processSyncValidators() {\n var syncValidatorsValid = true;\n forEach(that.$validators, function (validator, name) {\n var result = Boolean(validator(modelValue, viewValue));\n syncValidatorsValid = syncValidatorsValid && result;\n setValidity(name, result);\n });\n if (!syncValidatorsValid) {\n forEach(that.$asyncValidators, function (v, name) {\n setValidity(name, null);\n });\n return false;\n }\n return true;\n }\n function processAsyncValidators() {\n var validatorPromises = [];\n var allValid = true;\n forEach(that.$asyncValidators, function (validator, name) {\n var promise = validator(modelValue, viewValue);\n if (!isPromiseLike(promise)) {\n throw ngModelMinErr('nopromise', 'Expected asynchronous validator to return a promise but got \\'{0}\\' instead.', promise);\n }\n setValidity(name, undefined);\n validatorPromises.push(promise.then(function () {\n setValidity(name, true);\n }, function () {\n allValid = false;\n setValidity(name, false);\n }));\n });\n if (!validatorPromises.length) {\n validationDone(true);\n } else {\n that.$$q.all(validatorPromises).then(function () {\n validationDone(allValid);\n }, noop);\n }\n }\n function setValidity(name, isValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n that.$setValidity(name, isValid);\n }\n }\n function validationDone(allValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n doneCallback(allValid);\n }\n }\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$commitViewValue\n *\n * @description\n * Commit a pending update to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function () {\n var viewValue = this.$viewValue;\n this.$$timeout.cancel(this.$$pendingDebounce);\n\n // If the view value has not changed then we should just exit, except in the case where there is\n // a native validator on the element. In this case the validation state may have changed even though\n // the viewValue has stayed empty.\n if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) {\n return;\n }\n this.$$updateEmptyClasses(viewValue);\n this.$$lastCommittedViewValue = viewValue;\n\n // change to dirty\n if (this.$pristine) {\n this.$setDirty();\n }\n this.$$parseAndValidate();\n },\n $$parseAndValidate: function () {\n var viewValue = this.$$lastCommittedViewValue;\n var modelValue = viewValue;\n var that = this;\n this.$$parserValid = isUndefined(modelValue) ? undefined : true;\n\n // Reset any previous parse error\n this.$setValidity(this.$$parserName, null);\n this.$$parserName = 'parse';\n if (this.$$parserValid) {\n for (var i = 0; i < this.$parsers.length; i++) {\n modelValue = this.$parsers[i](modelValue);\n if (isUndefined(modelValue)) {\n this.$$parserValid = false;\n break;\n }\n }\n }\n if (isNumberNaN(this.$modelValue)) {\n // this.$modelValue has not been touched yet...\n this.$modelValue = this.$$ngModelGet(this.$$scope);\n }\n var prevModelValue = this.$modelValue;\n var allowInvalid = this.$options.getOption('allowInvalid');\n this.$$rawModelValue = modelValue;\n if (allowInvalid) {\n this.$modelValue = modelValue;\n writeToModelIfNeeded();\n }\n\n // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n // This can happen if e.g. $setViewValue is called from inside a parser\n this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function (allValid) {\n if (!allowInvalid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n writeToModelIfNeeded();\n }\n });\n function writeToModelIfNeeded() {\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n },\n $$writeModelToScope: function () {\n this.$$ngModelSet(this.$$scope, this.$modelValue);\n forEach(this.$viewChangeListeners, function (listener) {\n try {\n listener();\n } catch (e) {\n // eslint-disable-next-line no-invalid-this\n this.$$exceptionHandler(e);\n }\n }, this);\n },\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setViewValue\n *\n * @description\n * Update the view value.\n *\n * This method should be called when a control wants to change the view value; typically,\n * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}\n * directive calls it when the value of the input changes and {@link ng.directive:select select}\n * calls it when an option is selected.\n *\n * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`\n * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and\n * `$asyncValidators` are called and the value is applied to `$modelValue`.\n * Finally, the value is set to the **expression** specified in the `ng-model` attribute and\n * all the registered change listeners, in the `$viewChangeListeners` list are called.\n *\n * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n * and the `default` trigger is not listed, all those actions will remain pending until one of the\n * `updateOn` events is triggered on the DOM element.\n * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n * directive is used with a custom debounce for this particular event.\n * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`\n * is specified, once the timer runs out.\n *\n * When used with standard inputs, the view value will always be a string (which is in some cases\n * parsed into another type, such as a `Date` object for `input[date]`.)\n * However, custom controls might also pass objects to this method. In this case, we should make\n * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not\n * perform a deep watch of objects, it only looks for a change of identity. If you only change\n * the property of the object then ngModel will not realize that the object has changed and\n * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should\n * not change properties of the copy once it has been passed to `$setViewValue`.\n * Otherwise you may cause the model value on the scope to change incorrectly.\n *\n *
\n * In any case, the value passed to the method should always reflect the current value\n * of the control. For example, if you are calling `$setViewValue` for an input element,\n * you should pass the input DOM value. Otherwise, the control and the scope model become\n * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change\n * the control's DOM value in any way. If we want to change the control's DOM value\n * programmatically, we should update the `ngModel` scope expression. Its new value will be\n * picked up by the model controller, which will run it through the `$formatters`, `$render` it\n * to update the DOM, and finally call `$validate` on it.\n *
\n *\n * @param {*} value value from the view.\n * @param {string} trigger Event that triggered the update.\n */\n $setViewValue: function (value, trigger) {\n this.$viewValue = value;\n if (this.$options.getOption('updateOnDefault')) {\n this.$$debounceViewValueCommit(trigger);\n }\n },\n $$debounceViewValueCommit: function (trigger) {\n var debounceDelay = this.$options.getOption('debounce');\n if (isNumber(debounceDelay[trigger])) {\n debounceDelay = debounceDelay[trigger];\n } else if (isNumber(debounceDelay['default']) && this.$options.getOption('updateOn').indexOf(trigger) === -1) {\n debounceDelay = debounceDelay['default'];\n } else if (isNumber(debounceDelay['*'])) {\n debounceDelay = debounceDelay['*'];\n }\n this.$$timeout.cancel(this.$$pendingDebounce);\n var that = this;\n if (debounceDelay > 0) {\n // this fails if debounceDelay is an object\n this.$$pendingDebounce = this.$$timeout(function () {\n that.$commitViewValue();\n }, debounceDelay);\n } else if (this.$$rootScope.$$phase) {\n this.$commitViewValue();\n } else {\n this.$$scope.$apply(function () {\n that.$commitViewValue();\n });\n }\n },\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$overrideModelOptions\n *\n * @description\n *\n * Override the current model options settings programmatically.\n *\n * The previous `ModelOptions` value will not be modified. Instead, a\n * new `ModelOptions` object will inherit from the previous one overriding\n * or inheriting settings that are defined in the given parameter.\n *\n * See {@link ngModelOptions} for information about what options can be specified\n * and how model option inheritance works.\n *\n *
\n * **Note:** this function only affects the options set on the `ngModelController`,\n * and not the options on the {@link ngModelOptions} directive from which they might have been\n * obtained initially.\n *
\n *\n *
\n * **Note:** it is not possible to override the `getterSetter` option.\n *
\n *\n * @param {Object} options a hash of settings to override the previous options\n *\n */\n $overrideModelOptions: function (options) {\n this.$options = this.$options.createChild(options);\n this.$$setUpdateOnEvents();\n },\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$processModelValue\n * @description\n *\n * Runs the model -> view pipeline on the current\n * {@link ngModel.NgModelController#$modelValue $modelValue}.\n *\n * The following actions are performed by this method:\n *\n * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters}\n * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue}\n * - the `ng-empty` or `ng-not-empty` class is set on the element\n * - if the `$viewValue` has changed:\n * - {@link ngModel.NgModelController#$render $render} is called on the control\n * - the {@link ngModel.NgModelController#$validators $validators} are run and\n * the validation status is set.\n *\n * This method is called by ngModel internally when the bound scope value changes.\n * Application developers usually do not have to call this function themselves.\n *\n * This function can be used when the `$viewValue` or the rendered DOM value are not correctly\n * formatted and the `$modelValue` must be run through the `$formatters` again.\n *\n * @example\n * Consider a text input with an autocomplete list (for fruit), where the items are\n * objects with a name and an id.\n * A user enters `ap` and then selects `Apricot` from the list.\n * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`,\n * but the rendered value will still be `ap`.\n * The widget can then call `ctrl.$processModelValue()` to run the model -> view\n * pipeline again, which formats the object to the string `Apricot`,\n * then updates the `$viewValue`, and finally renders it in the DOM.\n *\n * \n \n
\n
\n Search Fruit:\n \n
\n
\n Model:
\n
{{selectedFruit | json}}
\n
\n
\n
\n \n angular.module('inputExample', [])\n .controller('inputController', function($scope) {\n $scope.items = [\n {name: 'Apricot', id: 443},\n {name: 'Clementine', id: 972},\n {name: 'Durian', id: 169},\n {name: 'Jackfruit', id: 982},\n {name: 'Strawberry', id: 863}\n ];\n })\n .component('basicAutocomplete', {\n bindings: {\n items: '<',\n onSelect: '&'\n },\n templateUrl: 'autocomplete.html',\n controller: function($element, $scope) {\n var that = this;\n var ngModel;\n that.$postLink = function() {\n ngModel = $element.find('input').controller('ngModel');\n ngModel.$formatters.push(function(value) {\n return (value && value.name) || value;\n });\n ngModel.$parsers.push(function(value) {\n var match = value;\n for (var i = 0; i < that.items.length; i++) {\n if (that.items[i].name === value) {\n match = that.items[i];\n break;\n }\n }\n return match;\n });\n };\n that.selectItem = function(item) {\n ngModel.$setViewValue(item);\n ngModel.$processModelValue();\n that.onSelect({item: item});\n };\n }\n });\n \n \n
\n \n
    \n
  • \n \n
  • \n
\n
\n
\n *
\n *\n */\n $processModelValue: function () {\n var viewValue = this.$$format();\n if (this.$viewValue !== viewValue) {\n this.$$updateEmptyClasses(viewValue);\n this.$viewValue = this.$$lastCommittedViewValue = viewValue;\n this.$render();\n // It is possible that model and view value have been updated during render\n this.$$runValidators(this.$modelValue, this.$viewValue, noop);\n }\n },\n /**\n * This method is called internally to run the $formatters on the $modelValue\n */\n $$format: function () {\n var formatters = this.$formatters,\n idx = formatters.length;\n var viewValue = this.$modelValue;\n while (idx--) {\n viewValue = formatters[idx](viewValue);\n }\n return viewValue;\n },\n /**\n * This method is called internally when the bound scope value changes.\n */\n $$setModelValue: function (modelValue) {\n this.$modelValue = this.$$rawModelValue = modelValue;\n this.$$parserValid = undefined;\n this.$processModelValue();\n },\n $$setUpdateOnEvents: function () {\n if (this.$$updateEvents) {\n this.$$element.off(this.$$updateEvents, this.$$updateEventHandler);\n }\n this.$$updateEvents = this.$options.getOption('updateOn');\n if (this.$$updateEvents) {\n this.$$element.on(this.$$updateEvents, this.$$updateEventHandler);\n }\n },\n $$updateEventHandler: function (ev) {\n this.$$debounceViewValueCommit(ev && ev.type);\n }\n };\n function setupModelWatcher(ctrl) {\n // model -> value\n // Note: we cannot use a normal scope.$watch as we want to detect the following:\n // 1. scope value is 'a'\n // 2. user enters 'b'\n // 3. ng-change kicks in and reverts scope value to 'a'\n // -> scope value did not change since the last digest as\n // ng-change executes in apply phase\n // 4. view should be changed back to 'a'\n ctrl.$$scope.$watch(function ngModelWatch(scope) {\n var modelValue = ctrl.$$ngModelGet(scope);\n\n // if scope model value and ngModel value are out of sync\n // This cannot be moved to the action function, because it would not catch the\n // case where the model is changed in the ngChange function or the model setter\n if (modelValue !== ctrl.$modelValue && (\n // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator\n // eslint-disable-next-line no-self-compare\n ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)) {\n ctrl.$$setModelValue(modelValue);\n }\n return modelValue;\n });\n }\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setValidity\n *\n * @description\n * Change the validity state, and notify the form.\n *\n * This method can be called within $parsers/$formatters or a custom validation implementation.\n * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n * (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n * The `validationErrorKey` should be in camelCase and will get converted into dash-case\n * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n * or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by AngularJS when validators do not run because of parse errors and\n * when `$asyncValidators` do not run because any of the `$validators` failed.\n */\n addSetValidityMethod({\n clazz: NgModelController,\n set: function (object, property) {\n object[property] = true;\n },\n unset: function (object, property) {\n delete object[property];\n }\n });\n\n /**\n * @ngdoc directive\n * @name ngModel\n * @restrict A\n * @priority 1\n * @param {expression} ngModel assignable {@link guide/expression Expression} to bind to.\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n * require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,\n * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n * - {@link ng.directive:input input}\n * - {@link input[text] text}\n * - {@link input[checkbox] checkbox}\n * - {@link input[radio] radio}\n * - {@link input[number] number}\n * - {@link input[email] email}\n * - {@link input[url] url}\n * - {@link input[date] date}\n * - {@link input[datetime-local] datetime-local}\n * - {@link input[time] time}\n * - {@link input[month] month}\n * - {@link input[week] week}\n * - {@link ng.directive:select select}\n * - {@link ng.directive:textarea textarea}\n *\n * ## Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the\n * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.\n *\n * The model must be assigned an entirely new object or collection before a re-rendering will occur.\n *\n * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression\n * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or\n * if the select is given the `multiple` attribute.\n *\n * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the\n * first level of the object (or only changing the properties of an item in the collection if it's an array) will still\n * not trigger a re-rendering of the model.\n *\n * ## CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n * - `ng-valid`: the model is valid\n * - `ng-invalid`: the model is invalid\n * - `ng-valid-[key]`: for each valid key added by `$setValidity`\n * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n * - `ng-pristine`: the control hasn't been interacted with yet\n * - `ng-dirty`: the control has been interacted with\n * - `ng-touched`: the control has been blurred\n * - `ng-untouched`: the control hasn't been blurred\n * - `ng-pending`: any `$asyncValidators` are unfulfilled\n * - `ng-empty`: the view does not contain a value or the value is deemed \"empty\", as defined\n * by the {@link ngModel.NgModelController#$isEmpty} method\n * - `ng-not-empty`: the view contains a non-empty value\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * @animations\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n *
\n   * //be sure to include ngAnimate as a module to hook into more\n   * //advanced animations\n   * .my-input {\n   *   transition:0.5s linear all;\n   *   background: white;\n   * }\n   * .my-input.ng-invalid {\n   *   background: red;\n   *   color:white;\n   * }\n   * 
\n *\n * @example\n * ### Basic Usage\n * \n \n \n \n

\n Update input to see transitions when valid/invalid.\n Integer is a valid value.\n

\n
\n \n
\n
\n *
\n *\n * @example\n * ### Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different from what the model exposes\n * to the view.\n *\n *
\n * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more\n * frequently than other parts of your code.\n *
\n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `
`, which will enable this behavior for all ``s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * \n \n
\n \n \n \n
user.name = 
\n
\n
\n \n angular.module('getterSetterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var _name = 'Brian';\n $scope.user = {\n name: function(newName) {\n // Note that newName can be undefined for two reasons:\n // 1. Because it is called as a getter and thus called with no arguments\n // 2. Because the property should actually be set to undefined. This happens e.g. if the\n // input is invalid\n return arguments.length ? (_name = newName) : _name;\n }\n };\n }]);\n \n *
\n */\n var ngModelDirective = ['$rootScope', function ($rootScope) {\n return {\n restrict: 'A',\n require: ['ngModel', '^?form', '^?ngModelOptions'],\n controller: NgModelController,\n // Prelink needs to run before any input directive\n // so that we can set the NgModelOptions in NgModelController\n // before anyone else uses it.\n priority: 1,\n compile: function ngModelCompile(element) {\n // Setup initial state of the control\n element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n return {\n pre: function ngModelPreLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0],\n formCtrl = ctrls[1] || modelCtrl.$$parentForm,\n optionsCtrl = ctrls[2];\n if (optionsCtrl) {\n modelCtrl.$options = optionsCtrl.$options;\n }\n modelCtrl.$$initGetterSetters();\n\n // notify others, especially parent forms\n formCtrl.$addControl(modelCtrl);\n attr.$observe('name', function (newValue) {\n if (modelCtrl.$name !== newValue) {\n modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);\n }\n });\n scope.$on('$destroy', function () {\n modelCtrl.$$parentForm.$removeControl(modelCtrl);\n });\n },\n post: function ngModelPostLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0];\n modelCtrl.$$setUpdateOnEvents();\n function setTouched() {\n modelCtrl.$setTouched();\n }\n element.on('blur', function () {\n if (modelCtrl.$touched) return;\n if ($rootScope.$$phase) {\n scope.$evalAsync(setTouched);\n } else {\n scope.$apply(setTouched);\n }\n });\n }\n };\n }\n };\n }];\n\n /* exported defaultModelOptions */\n var defaultModelOptions;\n var DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n /**\n * @ngdoc type\n * @name ModelOptions\n * @description\n * A container for the options set by the {@link ngModelOptions} directive\n */\n function ModelOptions(options) {\n this.$$options = options;\n }\n ModelOptions.prototype = {\n /**\n * @ngdoc method\n * @name ModelOptions#getOption\n * @param {string} name the name of the option to retrieve\n * @returns {*} the value of the option\n * @description\n * Returns the value of the given option\n */\n getOption: function (name) {\n return this.$$options[name];\n },\n /**\n * @ngdoc method\n * @name ModelOptions#createChild\n * @param {Object} options a hash of options for the new child that will override the parent's options\n * @return {ModelOptions} a new `ModelOptions` object initialized with the given options.\n */\n createChild: function (options) {\n var inheritAll = false;\n\n // make a shallow copy\n options = extend({}, options);\n\n // Inherit options from the parent if specified by the value `\"$inherit\"`\n forEach(options, /** @this */function (option, key) {\n if (option === '$inherit') {\n if (key === '*') {\n inheritAll = true;\n } else {\n options[key] = this.$$options[key];\n // `updateOn` is special so we must also inherit the `updateOnDefault` option\n if (key === 'updateOn') {\n options.updateOnDefault = this.$$options.updateOnDefault;\n }\n }\n } else {\n if (key === 'updateOn') {\n // If the `updateOn` property contains the `default` event then we have to remove\n // it from the event list and set the `updateOnDefault` flag.\n options.updateOnDefault = false;\n options[key] = trim(option.replace(DEFAULT_REGEXP, function () {\n options.updateOnDefault = true;\n return ' ';\n }));\n }\n }\n }, this);\n if (inheritAll) {\n // We have a property of the form: `\"*\": \"$inherit\"`\n delete options['*'];\n defaults(options, this.$$options);\n }\n\n // Finally add in any missing defaults\n defaults(options, defaultModelOptions.$$options);\n return new ModelOptions(options);\n }\n };\n defaultModelOptions = new ModelOptions({\n updateOn: '',\n updateOnDefault: true,\n debounce: 0,\n getterSetter: false,\n allowInvalid: false,\n timezone: null\n });\n\n /**\n * @ngdoc directive\n * @name ngModelOptions\n * @restrict A\n * @priority 10\n *\n * @description\n * This directive allows you to modify the behaviour of {@link ngModel} directives within your\n * application. You can specify an `ngModelOptions` directive on any element. All {@link ngModel}\n * directives will use the options of their nearest `ngModelOptions` ancestor.\n *\n * The `ngModelOptions` settings are found by evaluating the value of the attribute directive as\n * an AngularJS expression. This expression should evaluate to an object, whose properties contain\n * the settings. For example: `
\n *
\n * \n *
\n *
\n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 0 }\n * ```\n *\n * Notice that the `debounce` setting was not inherited and used the default value instead.\n *\n * You can specify that all undefined settings are automatically inherited from an ancestor by\n * including a property with key of `\"*\"` and value of `\"$inherit\"`.\n *\n * For example given the following fragment of HTML\n *\n *\n * ```html\n *
\n *
\n * \n *
\n *
\n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 200 }\n * ```\n *\n * Notice that the `debounce` setting now inherits the value from the outer `
` element.\n *\n * If you are creating a reusable component then you should be careful when using `\"*\": \"$inherit\"`\n * since you may inadvertently inherit a setting in the future that changes the behavior of your component.\n *\n *\n * ## Triggering and debouncing model updates\n *\n * The `updateOn` and `debounce` properties allow you to specify a custom list of events that will\n * trigger a model update and/or a debouncing delay so that the actual update only takes place when\n * a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different from the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController#$rollbackViewValue} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController#$rollbackViewValue}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ### Overriding immediate updates\n *\n * The following example shows how to override immediate updates. Changes on the inputs within the\n * form will update the model only when the control loses focus (blur event). If `escape` key is\n * pressed while the input field is focused, the value is reset to the value in the current model.\n *\n * \n * \n *
\n *
\n *
\n *
\n *
\n *
user.name = 
\n *
\n *
\n * \n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say', data: '' };\n *\n * $scope.cancel = function(e) {\n * if (e.keyCode === 27) {\n * $scope.userForm.userName.$rollbackViewValue();\n * }\n * };\n * }]);\n * \n * \n * var model = element(by.binding('user.name'));\n * var input = element(by.model('user.name'));\n * var other = element(by.model('user.data'));\n *\n * it('should allow custom events', function() {\n * input.sendKeys(' hello');\n * input.click();\n * expect(model.getText()).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say hello');\n * });\n *\n * it('should $rollbackViewValue when model changes', function() {\n * input.sendKeys(' hello');\n * expect(input.getAttribute('value')).toEqual('say hello');\n * input.sendKeys(protractor.Key.ESCAPE);\n * expect(input.getAttribute('value')).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say');\n * });\n * \n *
\n *\n * ### Debouncing updates\n *\n * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change.\n * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n *\n * \n * \n *
\n *
\n * Name:\n * \n *
\n *
\n *
user.name = 
\n *
\n *
\n * \n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say' };\n * }]);\n * \n *
\n *\n * ### Default events, extra triggers, and catch-all debounce values\n *\n * This example shows the relationship between \"default\" update events and\n * additional `updateOn` triggers.\n *\n * `default` events are those that are bound to the control, and when fired, update the `$viewValue`\n * via {@link ngModel.NgModelController#$setViewValue $setViewValue}. Every event that is not listed\n * in `updateOn` is considered a \"default\" event, since different control types have different\n * default events.\n *\n * The control in this example updates by \"default\", \"click\", and \"blur\", with different `debounce`\n * values. You can see that \"click\" doesn't have an individual `debounce` value -\n * therefore it uses the `*` debounce value.\n *\n * There is also a button that calls {@link ngModel.NgModelController#$setViewValue $setViewValue}\n * directly with a \"custom\" event. Since \"custom\" is not defined in the `updateOn` list,\n * it is considered a \"default\" event and will update the\n * control if \"default\" is defined in `updateOn`, and will receive the \"default\" debounce value.\n * Note that this is just to illustrate how custom controls would possibly call `$setViewValue`.\n *\n * You can change the `updateOn` and `debounce` configuration to test different scenarios. This\n * is done with {@link ngModel.NgModelController#$overrideModelOptions $overrideModelOptions}.\n *\n \n \n \n \n \n angular.module('optionsExample', [])\n .component('modelUpdateDemo', {\n templateUrl: 'template.html',\n controller: function() {\n this.name = 'Chinua';\n \n this.options = {\n updateOn: 'default blur click',\n debounce: {\n default: 2000,\n blur: 0,\n '*': 1000\n }\n };\n \n this.updateEvents = function() {\n var eventList = this.options.updateOn.split(' ');\n eventList.push('*');\n var events = {};\n \n for (var i = 0; i < eventList.length; i++) {\n events[eventList[i]] = this.options.debounce[eventList[i]];\n }\n \n this.events = events;\n };\n \n this.updateOptions = function() {\n var options = angular.extend(this.options, {\n updateOn: Object.keys(this.events).join(' ').replace('*', ''),\n debounce: this.events\n });\n \n this.form.input.$overrideModelOptions(options);\n };\n \n // Initialize the event form\n this.updateEvents();\n }\n });\n \n \n
\n Input: \n
\n Model: {{$ctrl.name}}\n
\n \n \n
\n
\n updateOn
\n \n \n \n \n \n \n \n \n \n \n \n
OptionDebounce value
{{key}}
\n \n
\n \n
\n
\n
\n *\n *\n * ## Model updates and validation\n *\n * The default behaviour in `ngModel` is that the model value is set to `undefined` when the\n * validation determines that the value is invalid. By setting the `allowInvalid` property to true,\n * the model will still be updated even if the value is invalid.\n *\n *\n * ## Connecting to the scope\n *\n * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression\n * on the scope refers to a \"getter/setter\" function rather than the value itself.\n *\n * The following example shows how to bind to getter/setters:\n *\n * \n * \n *
\n *
\n * \n *
\n *
user.name = 
\n *
\n *
\n * \n * angular.module('getterSetterExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * var _name = 'Brian';\n * $scope.user = {\n * name: function(newName) {\n * return angular.isDefined(newName) ? (_name = newName) : _name;\n * }\n * };\n * }]);\n * \n *
\n *\n *\n * ## Programmatically changing options\n *\n * The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not\n * watched for changes. However, it is possible to override the options on a single\n * {@link ngModel.NgModelController} instance with\n * {@link ngModel.NgModelController#$overrideModelOptions `NgModelController#$overrideModelOptions()`}.\n * See also the example for\n * {@link ngModelOptions#default-events-extra-triggers-and-catch-all-debounce-values\n * Default events, extra triggers, and catch-all debounce values}.\n *\n *\n * ## Specifying timezones\n *\n * You can specify the timezone that date/time input directives expect by providing its name in the\n * `timezone` property.\n *\n *\n * ## Formatting the value of `time` and `datetime-local`\n *\n * With the options `timeSecondsFormat` and `timeStripZeroSeconds` it is possible to adjust the value\n * that is displayed in the control. Note that browsers may apply their own formatting\n * in the user interface.\n *\n \n \n \n \n \n angular.module('timeExample', [])\n .component('timeExample', {\n templateUrl: 'timeExample.html',\n controller: function() {\n this.time = new Date(1970, 0, 1, 14, 57, 0);\n \n this.options = {\n timeSecondsFormat: 'ss',\n timeStripZeroSeconds: true\n };\n \n this.optionChange = function() {\n this.timeForm.timeFormatted.$overrideModelOptions(this.options);\n this.time = new Date(this.time);\n };\n }\n });\n \n \n
\n Default:\n
\n With options:\n \n
\n \n Options:
\n timeSecondsFormat:\n \n
\n timeStripZeroSeconds:\n \n \n
\n *
\n *\n * @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and\n * and its descendents.\n *\n * **General options**:\n *\n * - `updateOn`: string specifying which event should the input be bound to. You can set several\n * events using an space delimited list. There is a special event called `default` that\n * matches the default events belonging to the control. These are the events that are bound to\n * the control, and when fired, update the `$viewValue` via `$setViewValue`.\n *\n * `ngModelOptions` considers every event that is not listed in `updateOn` a \"default\" event,\n * since different control types use different default events.\n *\n * See also the section {@link ngModelOptions#triggering-and-debouncing-model-updates\n * Triggering and debouncing model updates}.\n *\n * - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n * custom value for each event. For example:\n * ```\n * ng-model-options=\"{\n * updateOn: 'default blur',\n * debounce: { 'default': 500, 'blur': 0 }\n * }\"\n * ```\n * You can use the `*` key to specify a debounce value that applies to all events that are not\n * specifically listed. In the following example, `mouseup` would have a debounce delay of 1000:\n * ```\n * ng-model-options=\"{\n * updateOn: 'default blur mouseup',\n * debounce: { 'default': 500, 'blur': 0, '*': 1000 }\n * }\"\n * ```\n * - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n * not validate correctly instead of the default behavior of setting the model to undefined.\n * - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n * `ngModel` as getters/setters.\n *\n *\n * **Input-type specific options**:\n *\n * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n * ``, ``, ... . It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * Note that changing the timezone will have no effect on the current date, and is only applied after\n * the next input / model change.\n *\n * - `timeSecondsFormat`: Defines if the `time` and `datetime-local` types should show seconds and\n * milliseconds. The option follows the format string of {@link date date filter}.\n * By default, the options is `undefined` which is equal to `'ss.sss'` (seconds and milliseconds).\n * The other options are `'ss'` (strips milliseconds), and `''` (empty string), which strips both\n * seconds and milliseconds.\n * Note that browsers that support `time` and `datetime-local` require the hour and minutes\n * part of the time string, and may show the value differently in the user interface.\n * {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.\n *\n * - `timeStripZeroSeconds`: Defines if the `time` and `datetime-local` types should strip the\n * seconds and milliseconds from the formatted value if they are zero. This option is applied\n * after `timeSecondsFormat`.\n * This option can be used to make the formatting consistent over different browsers, as some\n * browsers with support for `time` will natively hide the milliseconds and\n * seconds if they are zero, but others won't, and browsers that don't implement these input\n * types will always show the full string.\n * {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.\n *\n */\n var ngModelOptionsDirective = function () {\n NgModelOptionsController.$inject = ['$attrs', '$scope'];\n function NgModelOptionsController($attrs, $scope) {\n this.$$attrs = $attrs;\n this.$$scope = $scope;\n }\n NgModelOptionsController.prototype = {\n $onInit: function () {\n var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;\n var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);\n this.$options = parentOptions.createChild(modelOptionsDefinition);\n }\n };\n return {\n restrict: 'A',\n // ngModelOptions needs to run before ngModel and input directives\n priority: 10,\n require: {\n parentCtrl: '?^^ngModelOptions'\n },\n bindToController: true,\n controller: NgModelOptionsController\n };\n };\n\n // shallow copy over values from `src` that are not already specified on `dst`\n function defaults(dst, src) {\n forEach(src, function (value, key) {\n if (!isDefined(dst[key])) {\n dst[key] = value;\n }\n });\n }\n\n /**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n * @element ANY\n *\n * @description\n * The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current\n * DOM element, including directives on the element itself that have a lower priority than\n * `ngNonBindable`. This is useful if the element contains what appears to be AngularJS directives\n * and bindings but which should be ignored by AngularJS. This could be the case if you have a site\n * that displays snippets of code, for instance.\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n \n \n
Normal: {{1 + 2}}
\n
Ignored: {{1 + 2}}
\n
\n \n it('should check ng-non-bindable', function() {\n expect(element(by.binding('1 + 2')).getText()).toContain('3');\n expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n });\n \n
\n */\n var ngNonBindableDirective = ngDirective({\n terminal: true,\n priority: 1000\n });\n\n /* exported ngOptionsDirective */\n\n /* global jqLiteRemove */\n\n var ngOptionsMinErr = minErr('ngOptions');\n\n /**\n * @ngdoc directive\n * @name ngOptions\n * @restrict A\n *\n * @description\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of ``\n * DOM element.\n * * `disable`: The result of this expression will be used to disable the rendered `